:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glow: 0 0 20px rgba(99, 102, 241, 0.5);
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 20%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    perspective: 1000px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

input[type="text"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

select, .toggle-btn {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
}

select:hover, .toggle-btn:hover {
    border-color: var(--primary);
}

.audio-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.3s;
}

.audio-toggle.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: #a5b4fc;
}

.btn-download {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-download.loading {
    cursor: wait;
    opacity: 0.8;
}

.status-area {
    margin-top: 1.5rem;
    text-align: center;
    min-height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
}

.status-error { color: #f87171; }
.status-success { color: #4ade80; }
.status-info { color: #94a3b8; }

.download-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    transition: background 0.2s;
}

.download-link:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
