/* ─────────────────────────────────────────
   THE REQUEST LINE - CSS
   Radio Station Aesthetic
───────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #1a1a26;
    --surface: #16161f;
    --surface2: #1e1e2e;
    --border: #2a2a3e;
    --accent: #7c3aed;
    --accent2: #a855f7;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --red: #ef4444;
    --green: #22c55e;
    --gold: #f59e0b;
    --text: #e2e8f0;
    --text2: #94a3b8;
    --text3: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── JOIN SCREEN ── */
.join-overlay {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at center, #0d0d1a 0%, #050508 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.join-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 420px; width: 90%;
    text-align: center;
    box-shadow: 0 0 60px var(--accent-glow);
}

.join-logo .logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.9)); }
}

.join-logo h1 {
    font-size: 28px; font-weight: 800;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.join-logo p { color: var(--text2); font-size: 14px; margin-bottom: 32px; }

.join-form { display: flex; flex-direction: column; gap: 12px; }

.join-form input {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px;
    color: var(--text); font-size: 15px;
    outline: none; transition: border-color 0.2s;
}

.join-form input:focus { border-color: var(--accent2); }
.join-form input::placeholder { color: var(--text3); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white; border: none; border-radius: var(--radius);
    padding: 14px 24px; font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.join-footer { color: var(--text3); font-size: 12px; margin-top: 24px; }

/* ── APP LAYOUT ── */
.app { display: flex; flex-direction: column; height: 100vh; }

/* ── TOP BAR ── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
    z-index: 100;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }

.station-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px; padding: 4px 12px;
    font-size: 12px; font-weight: 700; color: var(--red);
    letter-spacing: 1px;
}

.on-air-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red);
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

.station-title { font-size: 18px; font-weight: 700; }

.listener-counter {
    display: flex; align-items: center; gap: 6px;
    color: var(--text2); font-size: 14px;
}

.dj-name {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-weight: 700; font-size: 14px;
}

/* ── MAIN LAYOUT ── */
.main-layout {
    display: flex; flex: 1; overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto;
}

.sidebar-section { padding: 20px 12px 8px; }

.sidebar-label {
    font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
    color: var(--text3); padding: 0 8px; margin-bottom: 8px;
}

.station-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.15s;
    position: relative;
}

.station-item:hover { background: var(--bg3); }
.station-item.active { background: rgba(124, 58, 237, 0.15); border: 1px solid rgba(124, 58, 237, 0.3); }

.station-icon { font-size: 20px; flex-shrink: 0; }

.station-info { flex: 1; min-width: 0; }
.station-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-sub { font-size: 11px; color: var(--text3); }

.now-playing-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    animation: blink 1.2s ease-in-out infinite;
}

.station-loading { color: var(--text3); font-size: 13px; padding: 12px; }

.sidebar-bottom {
    margin-top: auto; padding: 16px;
    border-top: 1px solid var(--border);
}

.user-badge {
    display: flex; align-items: center; gap: 8px;
    color: var(--text2); font-size: 13px; font-weight: 600;
}

/* ── CONTENT ── */
.content {
    flex: 1; overflow-y: auto;
    padding: 24px;
    display: flex; flex-direction: column; gap: 20px;
}

/* ── DJ BANNER ── */
.dj-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 16px;
    animation: slide-in 0.3s ease;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dj-avatar { font-size: 32px; flex-shrink: 0; }
.dj-label { font-size: 11px; font-weight: 700; color: var(--accent2); letter-spacing: 1px; margin-bottom: 4px; }
.dj-message { font-size: 14px; color: var(--text); line-height: 1.5; }

.dj-wave { display: flex; align-items: center; gap: 3px; margin-left: auto; flex-shrink: 0; }
.dj-wave span {
    width: 3px; border-radius: 2px; background: var(--accent2);
    animation: wave-bar 1s ease-in-out infinite;
}
.dj-wave span:nth-child(1) { height: 12px; animation-delay: 0s; }
.dj-wave span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.dj-wave span:nth-child(3) { height: 16px; animation-delay: 0.2s; }
.dj-wave span:nth-child(4) { height: 24px; animation-delay: 0.3s; }
.dj-wave span:nth-child(5) { height: 14px; animation-delay: 0.4s; }

@keyframes wave-bar {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ── PLAYER CARD ── */
.player-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex; flex-direction: column; gap: 20px;
}

.player-art {
    width: 120px; height: 120px;
    border-radius: var(--radius);
    overflow: hidden; position: relative;
    align-self: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.player-art img { width: 100%; height: 100%; object-fit: cover; }

.visualizer {
    position: absolute; inset: 0;
    background: rgba(10, 10, 15, 0.7);
    display: flex; align-items: flex-end; justify-content: center;
    gap: 4px; padding: 12px;
}

.visualizer span {
    flex: 1; border-radius: 2px;
    background: linear-gradient(to top, var(--accent), var(--accent2));
    animation: viz-bar 0.6s ease-in-out infinite alternate;
}
.visualizer span:nth-child(1) { animation-duration: 0.5s; animation-delay: 0s; }
.visualizer span:nth-child(2) { animation-duration: 0.7s; animation-delay: 0.1s; }
.visualizer span:nth-child(3) { animation-duration: 0.4s; animation-delay: 0.2s; }
.visualizer span:nth-child(4) { animation-duration: 0.8s; animation-delay: 0.05s; }
.visualizer span:nth-child(5) { animation-duration: 0.6s; animation-delay: 0.15s; }
.visualizer span:nth-child(6) { animation-duration: 0.45s; animation-delay: 0.25s; }
.visualizer span:nth-child(7) { animation-duration: 0.75s; animation-delay: 0.1s; }
.visualizer span:nth-child(8) { animation-duration: 0.55s; animation-delay: 0.2s; }

@keyframes viz-bar {
    from { height: 8px; }
    to { height: 60%; }
}

.player-info { text-align: center; }
.player-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.player-artist { color: var(--text2); font-size: 14px; margin-bottom: 6px; }
.player-station { color: var(--accent2); font-size: 12px; font-weight: 600; }

.player-controls { display: flex; flex-direction: column; gap: 12px; align-items: center; }

.volume-wrap {
    display: flex; align-items: center; gap: 10px;
    width: 100%; max-width: 280px;
}

.volume-slider {
    flex: 1; height: 4px; border-radius: 2px;
    background: var(--border); outline: none; cursor: pointer;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent2); cursor: pointer;
}

.control-buttons { display: flex; gap: 12px; }

.btn-play {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white; border: none; border-radius: 24px;
    padding: 12px 32px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-play:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-play:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-stop {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red); border-radius: 24px;
    padding: 12px 24px; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-stop:hover { background: rgba(239, 68, 68, 0.25); }

/* ── REQUEST MODE BANNER ── */
.request-mode-banner {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px; text-align: center;
}

.request-mode-banner span { color: var(--green); font-weight: 700; font-size: 14px; }
.request-mode-banner #request-song-info { color: var(--text2); font-size: 13px; margin: 4px 0; }
.request-resume-hint { color: var(--text3); font-size: 11px; }

/* ── REQUEST SECTION ── */
.request-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.request-header { margin-bottom: 16px; }
.request-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.request-header p { color: var(--text2); font-size: 13px; }

.search-wrap { display: flex; gap: 10px; margin-bottom: 16px; }

.search-wrap input {
    flex: 1;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    color: var(--text); font-size: 14px; outline: none;
    transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--accent2); }
.search-wrap input::placeholder { color: var(--text3); }

.btn-search {
    background: var(--accent); color: white;
    border: none; border-radius: var(--radius-sm);
    padding: 12px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.btn-search:hover { background: var(--accent2); }

/* ── SEARCH RESULTS ── */
.search-results { display: flex; flex-direction: column; gap: 8px; }

.result-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px;
    cursor: pointer; transition: all 0.15s;
}

.result-item:hover { border-color: var(--accent); background: rgba(124, 58, 237, 0.08); }

.result-thumb {
    width: 48px; height: 48px; border-radius: 6px;
    object-fit: cover; flex-shrink: 0;
    background: var(--border);
}

.result-info { flex: 1; min-width: 0; }
.result-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-artist { font-size: 12px; color: var(--text2); }
.result-duration { font-size: 11px; color: var(--text3); margin-top: 2px; }

.btn-request {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white; border: none; border-radius: 20px;
    padding: 8px 16px; font-size: 12px; font-weight: 600;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: all 0.2s;
}
.btn-request:hover { transform: translateY(-1px); }

/* ── REQUEST STATUS ── */
.request-status {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: 14px;
    text-align: center; color: var(--accent2);
}

.request-status.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.request-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── RESPONSIVE ── */

/* Tablet */
@media (max-width: 768px) {
    .topbar-right .dj-chip { 
        display: none; 
    }
}

/* Mobile */
@media (max-width: 600px) {
    /* Layout: topbar, horizontal stations, content */
    .layout {
        flex-direction: column;
    }
    
    /* Sidebar becomes horizontal scrollable strip */
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 0;
    }
    
    .sidebar.collapsed {
        width: 100%; /* Still show on mobile even when "collapsed" */
    }
    
    .sidebar-inner {
        width: auto;
        flex-direction: row;
        padding: 0;
        overflow: visible;
    }
    
    /* Hide sidebar toggle on mobile */
    .sidebar-toggle {
        display: none;
    }
    
    /* Sections become horizontal */
    .sidebar-section {
        display: flex;
        flex-direction: row;
        padding: 8px;
        gap: 8px;
        min-width: auto;
    }
    
    /* Station rows become compact pills */
    .station-row {
        flex-direction: column;
        min-width: 100px;
        padding: 10px 12px;
        text-align: center;
        gap: 6px;
        border-radius: 12px;
    }
    
    .s-icon {
        font-size: 24px;
        margin: 0;
    }
    
    .s-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .s-name {
        font-size: 11px;
        white-space: nowrap;
    }
    
    .s-sub {
        display: none; /* Hide subtitle on mobile */
    }
    
    .playing-bar {
        height: 10px;
        align-self: center;
    }
    
    .tooltip {
        display: none; /* No tooltips on mobile */
    }
    
    /* Hide labels */
    .sidebar-label {
        display: none;
    }
    
    /* Hide footer on mobile */
    .sidebar-footer {
        display: none;
    }
    
    /* Hide scrollbar but keep scrolling */
    .sidebar::-webkit-scrollbar {
        height: 0;
    }
    
    /* Content adjustments */
    .center {
        padding: 12px;
        gap: 12px;
    }
    
    /* Player card stacks vertically */
    .now-playing-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .art-wrap {
        margin: 0 auto;
    }
    
    .np-info {
        text-align: center;
    }
    
    .np-controls {
        align-items: center;
        width: 100%;
    }
    
    .ctrl-row {
        width: 100%;
        justify-content: center;
    }
    
    /* DJ ticker stacks */
    .dj-ticker {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    /* Search input full width */
    .search-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-inp {
        width: 100%;
    }
    
    .btn-search {
        width: 100%;
    }
    
    /* Topbar adjustments */
    .topbar-brand {
        font-size: 16px;
    }
    
    .listener-pill {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .live-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}