/**
 * SoundNest Live Radio — Premium Glassmorphic Charts & Top Hits Stylesheet
 * Ultra-Responsive, Compact Mobile & Desktop UI
 */

:root {
    --bg-main: #06080e;
    --bg-card: rgba(15, 23, 42, 0.55);
    --bg-card-hover: rgba(30, 41, 59, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.35);
    
    --primary: #6366f1;
    --primary-light: #a5b4fc;
    --gold: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.4);
    --silver: #cbd5e1;
    --bronze: #d97706;
    --rose: #f43f5e;
    --emerald: #10b981;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
}

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

body.charts-body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(99, 102, 241, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 88% 30%, rgba(244, 63, 94, 0.16) 0%, transparent 45%),
        radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.10) 0%, transparent 55%),
        radial-gradient(at 50% 50%, rgba(6, 8, 14, 0.85) 0%, transparent 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    padding: 20px 14px 40px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.charts-container {
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   Header (Compact & Glassmorphic)
   ========================================================================== */
.charts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    gap: 10px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.back-to-player-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-to-player-btn:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--border-glow);
    transform: translateX(-2px);
}

.back-to-player-btn svg {
    width: 15px;
    height: 15px;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.badge-charts {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--gold);
    white-space: nowrap;
}

.pulse-gold {
    width: 5px;
    height: 5px;
    background: var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--gold);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.charts-title {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-lang-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-lang-btn:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.45);
}

.btn-listen-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-listen-live:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-listen-live svg {
    width: 12px;
    height: 12px;
}

/* ==========================================================================
   Hero #1 Banner (Compact & Luxurious)
   ========================================================================== */
.hero-number-one {
    position: relative;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.10) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 25px rgba(251, 191, 36, 0.08);
    animation: fadeIn 0.4s ease;
}

.hero-glow-bg {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    filter: blur(35px);
    pointer-events: none;
}

.crown-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius-full);
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.hero-track-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-rank-box {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 16px var(--gold-glow);
    line-height: 1;
    flex-shrink: 0;
}

.hero-track-info {
    flex: 1;
    min-width: 0;
}

.top-one-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.top-one-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.badge-genre {
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    color: #a5b4fc;
}

.badge-metric {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ==========================================================================
   Tabs (Smooth & Swipeable)
   ========================================================================== */
.charts-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.charts-tabs::-webkit-scrollbar {
    display: none;
}

.chart-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.chart-tab-btn svg {
    width: 14px;
    height: 14px;
}

.chart-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.chart-tab-btn.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

/* ==========================================================================
   Main Chart Content & Compact Rows
   ========================================================================== */
.charts-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    min-height: 320px;
}

.chart-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4px;
}

.chart-table-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.chart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: all 0.18s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.chart-item-row:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(2px);
}

.chart-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.chart-rank {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-dim);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.chart-rank.rank-1 {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

.chart-rank.rank-2 {
    color: var(--silver);
}

.chart-rank.rank-3 {
    color: var(--bronze);
}

.chart-title-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.chart-song-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.chart-col-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-col-stats {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    color: #f87171;
    background: rgba(244, 63, 94, 0.10);
    border: 1px solid rgba(244, 63, 94, 0.22);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Loading & Empty */
.chart-loading,
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    gap: 12px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

/* Footer */
.charts-footer {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-dim);
    padding: 10px 0;
}

/* ==========================================================================
   Mobile Responsive Fine-Tuning (< 600px)
   ========================================================================== */
@media (max-width: 600px) {
    body.charts-body {
        padding: 12px 10px 32px;
    }

    .charts-container {
        gap: 12px;
    }

    .charts-header {
        padding: 10px 12px;
        border-radius: var(--radius-md);
    }

    .header-brand {
        gap: 8px;
    }

    .back-to-player-btn {
        padding: 5px 8px;
        font-size: 11.5px;
    }

    .charts-title {
        font-size: 16px;
    }

    .badge-charts {
        font-size: 8.5px;
    }

    .btn-listen-live {
        padding: 6px 10px;
        font-size: 11.5px;
    }

    .hero-number-one {
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }

    .hero-rank-box {
        font-size: 26px;
    }

    .top-one-title {
        font-size: 15px;
    }

    .chart-tab-btn {
        padding: 7px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .chart-tab-btn svg {
        width: 12px;
        height: 12px;
    }

    .charts-content {
        padding: 6px;
        border-radius: var(--radius-md);
    }

    .chart-item-row {
        padding: 8px 10px;
        gap: 8px;
    }

    .chart-rank {
        font-size: 14px;
        width: 24px;
    }

    .chart-song-title {
        font-size: 12.5px;
    }

    .chart-col-meta {
        font-size: 10.5px;
    }

    .chart-col-stats {
        font-size: 10.5px;
        padding: 2px 6px;
    }
}
