:root {
    --bg-color: #0e0e12;
    --panel-bg: rgba(30, 30, 40);
    --primary: #B2EBD4;
    --secondary: #3B5998;
    --secondary-glow: rgba(59, 89, 152, 0.5);
    --accent: #7eb8f7;
    --text-main: #f0f0f0;
    --text-muted: #888;
    --glass-bg: rgba(18, 18, 26, 0.55);
    --glass-border: rgba(178, 235, 212, 0.12);
    --eq-grid: rgba(178, 235, 212, 0.06);
    --eq-curve: #B2EBD4;
    --eq-fill: rgba(178, 235, 212, 0.08);
    --eq-node: #B2EBD4;
    --eq-node-active: #ffffff;
}

* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    user-select: none;
}

.logo-text, .nav-links li, .eq-header h3, .now-playing h3,
h2, h3, .version-tag {
    font-family: 'Bitcount Single', cursive;
    letter-spacing: 1.5px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    text-transform: lowercase;
}

.mouse-glow {
    position: fixed;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(178, 235, 212, 0.3) 0%, rgba(178, 235, 212, 0.1) 40%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px dashed rgba(178,235,212,0.25);
    border-radius: 8px;
    transition: transform 0.5s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
    z-index: 100;
}

.glass:hover {
    transform: scale(1.01) perspective(500px) rotateX(1deg) rotateY(1deg);
    transition: transform 0.5s cubic-bezier(0.025, 1.5, 0.5, 2);
}

.glass2 {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px dashed rgba(178,235,212,0.25);
    border-radius: 8px;
    transition: transform 0.5s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
    z-index: 100;
}

.glass2:hover {
    
}

/* Loading */
#loading-screen {
    position: fixed; inset: 0;
    background: var(--bg-color);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
    gap: 0.5rem;
}
.logo-text { color: var(--primary); font-size: 2.8rem; letter-spacing: 4px; }
.glow { text-shadow: 0 0 15px var(--primary), 0 0 35px rgba(178,235,212,0.4); }
.loading-sub { color: var(--text-muted); font-size: 0.8rem; letter-spacing: 4px; text-transform: uppercase; }

/* Layout */
.app-container { display: flex; height: 100vh; padding: 0.8rem; gap: 0.8rem; }

/* Sidebar */
.sidebar {
    width: 220px; padding: 1.5rem 1rem;
    display: flex; flex-direction: column;
    flex-shrink: 0;
}
.brand { margin-bottom: 2.5rem; text-align: center; }
.brand .logo-text { font-size: 1.8rem; }
.nav-links { list-style: none; flex: 1; }
.nav-links li {
    padding: 0.75rem 1rem; margin-bottom: 0.3rem;
    border-radius: 10px; cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-muted); font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.6rem;
    transition: transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
}
.nav-links li:hover {
    background: rgba(255,255,255,0.05);
    transform: scale(1.03) perspective(600px) rotateX(10deg);
    transition: transform 0.5s cubic-bezier(0.25, 1.5, 0.5, 2);
}
.nav-links li.active {
    background: linear-gradient(135deg, var(--secondary), rgba(59,89,152,0.6));
    color: var(--text-main);
}
.nav-icon { font-size: 1rem; opacity: 0.7; }
.nav-links li i { font-size: 1rem; opacity: 0.7; }
.nav-links li.active i { opacity: 1; }
.sidebar-footer { text-align: center; margin-top: 1rem; }
.version-tag { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 2px; }

/* Main Content */
.main-content { flex: 1; position: relative; overflow: hidden; min-width: 0; }
.page {
    position: absolute; inset: 0;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
    display: flex; flex-direction: column; gap: 0.8rem; padding: 0.4rem;
    overflow: hidden;
}
.page.active { opacity: 1; pointer-events: auto; }

/* --- SIDE-BY-SIDE EQUALIZER SYSTEM SPLIT LAYOUT --- */
.main-layout-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 0.8rem;
    overflow: hidden;
}

/* Left Stack: Player Controls stacked over the Spectral Graph */
.left-deck {
    display: flex;
    flex-direction: column;
    width: 320px; /* Locked cross-width for precise left dashboard boundary */
    height: 100%;
    gap: 0.8rem;
    flex-shrink: 0;
}

/* Now Playing Container Card Styles */
.now-playing {
    width: 100%;
    padding: 1rem;
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.album-art-placeholder {
    width: 84px; height: 84px; border-radius: 50%;
    position: relative; display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

#album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing h3 { font-size: 0.80rem; color: var(--text-main); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing #current-song-time { font-size: 0.70rem; color: var(--text-muted); font-family: 'Inter', sans-serif; }

.progress-bar-wrap { width: 100%; padding: 0 0.2rem; }
.progress-bar-bg {
    width: 100%; height: 10px; background: rgba(255,255,255,0.1);
    border-radius: 50px; overflow: hidden; cursor: pointer;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}
.progress-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 50px; transition: width 0.5s linear;
}

.transport-controls { display: flex; gap: 0.8rem; align-items: center; }
.control-btn {
    background: transparent; border: none; color: var(--primary);
    font-size: 1.2rem; cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
    line-height: 1;
}

.control-btn:hover {
    transform: scale(1.2) perspective(600px) rotateX(30deg);
    transition: transform 0.3s cubic-bezier(0.25, 1.5, 0.5, 2);
}

.play-btn {
    font-size: 1.4rem;
    background: rgba(178,235,212,0.1);
    border: 1px solid rgba(178,235,212,0.2) !important;
    border-radius: 50%; width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.4s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
}
.play-btn:hover {
    background: rgba(178,235,212,0.2);
    transform: scale(1.1) perspective(200px) rotateX(20deg);
    transition: transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 2);
}

/* Left aligned label tracking layouts */
.control-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.control-label-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 0.1rem;
}
.control-label {
    font-family: 'Bitcount Single', cursive;
    font-size: 0.80rem;
    color: var(--text-main);
}
.control-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--primary);
}

.sliders {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.08);
    height: 8px;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sliders:hover {
    background: rgba(255,255,255,0.16);
}

.sliders::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 18px;
    border-radius: 8px;
    background: var(--primary);
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 12px rgba(178,235,212,0.35);
    transition: height 0.2s ease, width 0.5s ease, transform 0.2s ease, background 0.2s ease;
}

.sliders::-webkit-slider-thumb:hover {
    transform: scale(1.05);
    background: #ffffff;
}

.sliders:active::-webkit-slider-thumb,
.sliders:focus-visible::-webkit-slider-thumb {
    height: 25px;
    width: 10px;
}

.sliders::-moz-range-thumb {
    width: 1px;
    height: 18px;
    border-radius: 8px;
    background: var(--primary);
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 12px rgba(178,235,212,0.35);
    transition: height 0.2s ease, width 0.5s ease, transform 0.2s ease, background 0.2s ease;
}

.sliders:active::-moz-range-thumb,
.sliders:focus-visible::-moz-range-thumb {
    height: 25px;
    width: 10px;
}

.sliders::-moz-range-track {
    background: transparent;
}

.sliders::-ms-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid rgba(255,255,255,0.3);
}

.sliders::-ms-track {
    width: 100%;
    background: transparent;
    border-color: transparent;
    color: transparent;
}

/* Waveform Display Frame on the Left pane */
.visualizer-container {
    flex: 1;          /* <--- Add this to swallow up remaining height */
    width: 100%;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.visualizer-label {
    position: absolute;
    top: 14px;
    right: 16px;
    font-family: 'Bitcount Single', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.5;
}

/* RIGHT SECTION: Vertical Full-Height EQ Matrix Graph Grid Component */
.eq-section {
    flex: 1; /* Dynamically expands outward covering the entire right panel region */
    height: 100%;
    padding: 1.5rem 1.5rem;
    display: flex; 
    flex-direction: column; 
    gap: 0.6rem;
    min-width: 0;
}

.eq-header { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.eq-header h3 { font-size: 1.1rem; color: var(--primary); }
.eq-controls { display: flex; align-items: center; gap: 0.8rem; }
.eq-hint-row { display: flex; width: 100%; margin-top: -0.2rem; flex-shrink: 0; }
.eq-hint { font-size: 0.7rem; color: var(--text-muted); font-family: 'Inter', sans-serif; }

.eq-controls select, .eq-controls button {
    background: rgba(0,0,0,0.35); color: var(--text-main);
    border: 1px solid rgba(178,235,212,0.2);
    padding: 0.4rem 0.8rem; border-radius: 8px; cursor: pointer; outline: none;
    font-size: 0.8rem; transition: border-color 0.2s;
}
.eq-controls select:hover, .eq-controls button:hover { border-color: var(--primary); }
.eq-controls select option { background: var(--panel-bg); }

/* Parametric Screen Matrix Boundaries wrapper inside full height */
.eq-canvas-wrap {
    flex: 1; 
    position: relative; 
    min-height: 0;
    border-radius: 20px; 
    overflow: hidden;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--eq-grid);
}
#eq-canvas {
    width: 100%; height: 100%;
    cursor: crosshair; display: block;
}

/* Band tracking nodes & contextual elements */
.band-tooltip {
    position: absolute; pointer-events: none;
    background: rgba(14,14,18,0.9);
    border: 1px solid rgba(178,235,212,0.3);
    border-radius: 6px; padding: 0.4rem 0.7rem;
    font-size: 0.75rem; color: var(--text-main);
    font-family: 'Inter', sans-serif;
    white-space: nowrap; z-index: 10;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.band-tooltip.hidden { display: none; }

.eq-band-list {
    display: flex; gap: 0.4rem; flex-wrap: wrap;
    flex-shrink: 0; min-height: 28px;
    padding-top: 0.2rem;
}
.band-chip {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(0,0,0,0.3); border: 1px solid;
    border-radius: 20px; padding: 0.2rem 0.6rem;
    font-size: 0.7rem; font-family: 'Inter', sans-serif;
    cursor: pointer; transition: background 0.2s;
}
.band-chip:hover { background: rgba(255,255,255,0.08); }
.band-chip .chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.band-chip .chip-remove { color: #ff4d4d; opacity: 0.6; margin-left: 2px; font-size: 0.8rem; }
.band-chip .chip-remove:hover { opacity: 1; }

/* Upload Page Styles */
.upload-container {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    border: 2px dashed rgba(178,235,212,0.25);
    gap: 0.5rem; transition: all 0.3s; cursor: pointer;
}
.upload-container:hover, .upload-container.dragover {
    background: rgba(178,235,212,0.05);
    border-color: var(--primary);
}
.upload-icon { font-size: 3.5rem; }
.upload-container h2 { font-size: 1.3rem; }
.upload-container p { color: var(--text-muted); font-size: 0.85rem; }
.upload-btn {
    margin-top: 0.5rem; background: var(--secondary);
    color: white; border: none; padding: 0.7rem 2rem;
    border-radius: 8px; cursor: pointer; transition: background 0.2s;
    font-size: 0.85rem;
    transition: transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 1);
    transform-origin: center;
}
.upload-btn:hover {
    background: #4a6bb5; 
    transform: scale(1.2) perspective(200px) rotateX(10deg);
    transition: transform 0.5s cubic-bezier(0.25, 1.5, 0.5, 2);
}

/* Playlist Page Styles */
.playlist-header { display: flex; gap: 0.8rem; padding: 1rem; flex-shrink: 0; }
.playlist-header input, .playlist-header select, .playlist-header button {
    padding: 0.5rem 0.8rem; border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3); color: var(--text-main); outline: none;
    font-size: 0.85rem;
}

.playlist-header select option { background: var(--panel-bg); }
.playlist-header input { flex: 1; }
.playlist-header input::placeholder { color: var(--text-muted); }
.playlist-header button { cursor: pointer; border-color: rgba(255,77,77,0.3); }
.playlist-header button:hover { border-color: #ff4d4d; }
.playlist-container { flex: 1; overflow-y: auto; padding: 1rem; min-height: 220px; }

/* Keep playlist container height stable when empty */
.playlist-container:empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Show a friendly message when the playlist is empty */
.playlist-container:empty::before {
    content: "nothing to see here...";
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-family: 'Bitcount Single', sans-serif;
    padding: 2.2rem 1rem;
    font-size: 0.95rem;
    pointer-events: none;
}

.playlist-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.9rem 1rem; margin-bottom: 0.4rem;
    background: rgba(0,0,0,0.25); border-radius: 10px;
    cursor: pointer; transition: background 0.2s; border: 1px solid transparent;
}
.playlist-item:hover { background: rgba(178,235,212,0.06); border-color: var(--glass-border); }
.playlist-item.playing {
    border-left: 3px solid var(--primary);
    background: rgba(59,89,152,0.25);
}
.song-info h4 { font-size: 0.9rem; margin-bottom: 0.2rem; font-family: 'Inter', sans-serif; }
.song-info small { color: var(--text-muted); font-size: 0.75rem; }
.remove-btn {
    background: transparent; color: #ff4d4d; border: none;
    cursor: pointer; font-size: 1rem; opacity: 0.5; transition: opacity 0.2s;
}
.remove-btn:hover { opacity: 1; }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000; }
.toast {
    background: var(--panel-bg); border-left: 3px solid var(--primary);
    padding: 0.8rem 1.5rem; margin-top: 0.5rem; border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    font-size: 0.85rem; font-family: 'Inter', sans-serif;
    animation: slideIn 0.3s ease forwards, fadeOut 0.3s ease 2.7s forwards;
}
@keyframes slideIn { from { transform: translateX(110%); } to { transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }