/* ═══════════════════════════════════════════════════
   KARAOKE.studio — Mobile-First Landing CSS
   Premium dark theme inspired by ASCII.video
   ═══════════════════════════════════════════════════ */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
    --bg-deep: #0a0a12;
    --bg-card: rgba(18, 18, 30, 0.85);
    --bg-input: rgba(12, 12, 22, 0.9);
    --border-glow: rgba(138, 43, 226, 0.35);
    --accent-primary: #8a2be2;
    --accent-secondary: #00e5ff;
    --accent-warm: #ff6ec7;
    --text-primary: #e8e8f0;
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    --glow-purple: 0 0 20px rgba(138, 43, 226, 0.3);
    --glow-cyan: 0 0 15px rgba(0, 229, 255, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(138, 43, 226, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 110, 199, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ═══ NAVBAR ═══ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(10, 10, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(138, 43, 226, 0.15);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo .highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.nav-link:hover {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.nav-link.studio-link {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ═══ MAIN CONTAINER ═══ */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 12px 40px;
}

/* ═══ VISUALIZER ═══ */
.viz-section {
    margin-top: 8px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-glow);
    box-shadow: var(--glow-purple);
    background: #000;
    position: relative;
}

.viz-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.viz-canvas-wrap canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#lyrics-html-overlay {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    padding: 0 16px;
    transition: opacity 0.3s ease;
}

#lyrics-active-line {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8), 0 0 20px rgba(138, 43, 226, 0.4);
    min-height: 32px;
    line-height: 1.4;
}

#lyrics-upcoming-line {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    min-height: 24px;
    margin-top: 6px;
}

/* Lyrics word highlighting */
.lyric-word {
    display: inline-block;
    margin: 0 3px;
    transition: all 0.15s ease;
}

.lyric-word.active,
.lyric-highlight {
    color: var(--accent-warm);
    text-shadow: 0 0 12px var(--accent-warm), 0 0 24px var(--accent-warm);
    transform: scale(1.05);
    display: inline-block;
}

/* ═══ CONTROLS ═══ */
.controls-section {
    margin-top: 12px;
}

.control-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.control-row.centered {
    justify-content: center;
}

/* ═══ BUTTONS ═══ */
.btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #6a1fb8);
    border-color: var(--accent-primary);
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    box-shadow: var(--glow-purple);
}

.btn-accent {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.btn-accent:hover {
    background: rgba(0, 229, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.btn-warm {
    border-color: var(--accent-warm);
    color: var(--accent-warm);
}

.btn-warm:hover {
    background: rgba(255, 110, 199, 0.1);
}

/* Play button */
.btn-play {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-warm));
    border: none;
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4);
}

.btn-play:active {
    transform: scale(0.93);
}

.btn-play:hover {
    box-shadow: 0 6px 30px rgba(138, 43, 226, 0.6);
}

/* ═══ SELECT / DROPDOWNS ═══ */
.select-wrap {
    position: relative;
    flex: 1;
}

.select-wrap label {
    display: block;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.select {
    width: 100%;
    padding: 10px 14px;
    padding-right: 32px;
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a8a9a' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease;
}

.select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.15);
}

/* ═══ STATUS BAR ═══ */
.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
}

.status-bar .status-icon {
    font-size: 1rem;
}

.status-bar .status-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══ SECTION HEADERS ═══ */
.section-header {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(138, 43, 226, 0.3), transparent);
}

/* ═══ PROGRESS BAR ═══ */
.progress-wrap {
    margin: 8px 0;
    padding: 0 4px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-warm));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ═══ CARD PANELS ═══ */
.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    backdrop-filter: blur(12px);
}

/* ═══ COLLAPSIBLE ═══ */
.collapse-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.collapse-toggle:hover {
    border-color: var(--accent-primary);
}

.collapse-toggle .arrow {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.collapse-toggle.open .arrow {
    transform: rotate(90deg);
}

.collapse-body {
    display: none;
    animation: slideDown 0.3s ease;
}

.collapse-body.open {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══ FOOTER ═══ */
.footer {
    text-align: center;
    padding: 20px 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

/* ═══ HIDDEN FILE INPUTS ═══ */
.hidden-input {
    display: none;
}

/* ═══ ANIMATIONS ═══ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ═══ RESPONSIVE ═══ */
@media (min-width: 768px) {
    .app-container {
        max-width: 700px;
        padding: 0 20px 60px;
    }

    .viz-canvas-wrap {
        border-radius: var(--radius);
    }

    #lyrics-active-line {
        font-size: 28px;
    }
}

@media (max-width: 380px) {
    .btn {
        font-size: 0.72rem;
        padding: 8px 12px;
    }

    .select {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    #lyrics-active-line {
        font-size: 18px;
    }
}