:root {
    --bg-primary: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --input-bg: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --input-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Animated Blobs */
.bg-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 10s infinite alternate ease-in-out;
}
.blob-1 { background: #6366f1; top: -50px; left: -50px; }
.blob-2 { background: #ec4899; bottom: -50px; right: -50px; animation-delay: -5s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
}

#theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 3.5rem;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 0.75rem;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto;
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-icon {
    width: 42px;
    height: 42px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card h3 { font-size: 1.2rem; }
.card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.4; }

/* Inputs & Buttons */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

input[type="url"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
}

input[type="url"]:focus {
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--border-color); }

/* Output Display Box */
.output-box {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.hidden { display: none; }