/* ═══════════════════════════════════════════
   TERMINUS MUSIC VAULT — Web Player Styles
   Premium Dark Glassmorphic UI
   ═══════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #e8e8f0;
    --text-secondary: rgba(232, 232, 240, 0.6);
    --text-muted: rgba(232, 232, 240, 0.35);
    --accent: #f97316;
    --accent-glow: rgba(249, 115, 22, 0.3);
    --accent-secondary: #fb923c;
    --danger: #ef4444;
    --success: #22c55e;
    --purple: #a855f7;
    --cyan: #06b6d4;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ═══ HEADER ═══ */
.header {
    position: relative;
    padding: 20px 24px 16px;
    text-align: center;
    z-index: 10;
}

.header-glow {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 200px;
    background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
    pointer-events: none;
    opacity: 0.6;
}

.header-content {
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.brand-icon {
    font-size: 28px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.brand-text {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary), #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ═══ NOW PLAYING ═══ */
.now-playing {
    padding: 0 24px 20px;
}

.artwork-container {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 24px;
    border-radius: 20px;
    overflow: hidden;
}

.artwork-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.artwork-glow.active {
    opacity: 0.8;
    animation: glow-pulse 3s ease-in-out infinite;
}

.artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.artwork-container:hover .artwork {
    transform: scale(1.02);
}

.artwork-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 12px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-overlay.active {
    opacity: 1;
}

/* ═══ VISUALIZER ═══ */
.visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
}

.visualizer .bar {
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.15s ease;
    min-height: 3px;
}

.visualizer.playing .bar {
    animation: eq-bounce 0.6s ease-in-out infinite alternate;
}

.visualizer.playing .bar:nth-child(1) { animation-delay: 0.00s; height: 8px; }
.visualizer.playing .bar:nth-child(2) { animation-delay: 0.05s; height: 20px; }
.visualizer.playing .bar:nth-child(3) { animation-delay: 0.10s; height: 12px; }
.visualizer.playing .bar:nth-child(4) { animation-delay: 0.15s; height: 24px; }
.visualizer.playing .bar:nth-child(5) { animation-delay: 0.20s; height: 16px; }
.visualizer.playing .bar:nth-child(6) { animation-delay: 0.25s; height: 28px; }
.visualizer.playing .bar:nth-child(7) { animation-delay: 0.30s; height: 10px; }
.visualizer.playing .bar:nth-child(8) { animation-delay: 0.35s; height: 22px; }
.visualizer.playing .bar:nth-child(9) { animation-delay: 0.40s; height: 14px; }
.visualizer.playing .bar:nth-child(10) { animation-delay: 0.45s; height: 26px; }
.visualizer.playing .bar:nth-child(11) { animation-delay: 0.50s; height: 18px; }
.visualizer.playing .bar:nth-child(12) { animation-delay: 0.55s; height: 6px; }

/* ═══ TRACK INFO ═══ */
.track-info {
    text-align: center;
    margin-bottom: 20px;
}

.track-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.track-artist {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 10px;
}

.track-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 11px;
    padding: 3px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ═══ PROGRESS BAR ═══ */
.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
    position: relative;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-glow);
    opacity: 0;
    transition: opacity 0.2s;
    left: 0;
}

.progress-container:hover .progress-thumb {
    opacity: 1;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ═══ CONTROLS ═══ */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    transform: scale(1.08);
}

.ctrl-btn.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.ctrl-play {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: #000;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.ctrl-play:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px var(--accent-glow);
    color: #000;
}

/* ═══ VOLUME ═══ */
.volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 24px;
}

.vol-icon {
    font-size: 14px;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
    border: none;
}

/* ═══ TRACK LIST ═══ */
.track-list {
    padding: 0 16px 100px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    padding: 0 8px 12px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 8px;
}

.track-count {
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0;
    color: var(--text-muted);
}

.tracks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

.track-row:hover {
    background: var(--bg-glass);
}

.track-row.active {
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.track-row-art {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.track-row-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-row-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.track-row-duration {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* ═══ LOADING ═══ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    text-align: center;
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-glass);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

.loader p {
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ═══ ANIMATIONS ═══ */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

@keyframes eq-bounce {
    0% { height: 4px; }
    100% { height: var(--h, 20px); }
}

.visualizer.playing .bar:nth-child(1) { --h: 8px; }
.visualizer.playing .bar:nth-child(2) { --h: 22px; }
.visualizer.playing .bar:nth-child(3) { --h: 14px; }
.visualizer.playing .bar:nth-child(4) { --h: 26px; }
.visualizer.playing .bar:nth-child(5) { --h: 18px; }
.visualizer.playing .bar:nth-child(6) { --h: 30px; }
.visualizer.playing .bar:nth-child(7) { --h: 12px; }
.visualizer.playing .bar:nth-child(8) { --h: 24px; }
.visualizer.playing .bar:nth-child(9) { --h: 16px; }
.visualizer.playing .bar:nth-child(10) { --h: 28px; }
.visualizer.playing .bar:nth-child(11) { --h: 20px; }
.visualizer.playing .bar:nth-child(12) { --h: 8px; }

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

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
