/* =================================================================
   equalizer.css — 15-band equalizer modal.
   Backdrop + floating panel with one column per band (preamp + 15
   frequency bands), vertical range sliders.
   ================================================================= */

/* Player-bar EQ toggle button. Lives alongside the volume controls. */
.eq-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    opacity: 0.7;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: opacity 0.2s, color 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.eq-toggle-btn:hover {
    opacity: 1;
    background: var(--overlay-selected);
}

.eq-toggle-btn.active {
    opacity: 1;
    color: var(--accent-primary);
}

/* Backdrop — darkens the whole app while the modal is open. Hidden by
   default; .eq-modal-open makes it visible. */
.eq-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: eq-fade-in 0.15s ease-out;
}

.eq-modal-backdrop.eq-modal-open {
    display: flex;
}

@keyframes eq-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.eq-modal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 20px 24px 24px;
    /* Width target: 820px when the viewport allows it, otherwise
       collapse to fill the available room. Hard `min-width: 820px`
       was forcing horizontal overflow on 720p (1280×720 desktop) where
       the available area after sidebar (240px) is barely 1040px and
       the modal padding/EQ controls didn't fit. */
    width: min(820px, 95vw);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* ---- Header ------------------------------------------------------ */
.eq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 18px;
    gap: 24px;
}

.eq-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.eq-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.eq-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Enable/disable toggle switch. */
.eq-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    user-select: none;
}

.eq-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.eq-switch-track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--bg-card);
    position: relative;
    transition: background 0.2s;
}

.eq-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform 0.2s, background 0.2s;
}

.eq-switch input:checked + .eq-switch-track {
    background: var(--accent-primary);
}

.eq-switch input:checked + .eq-switch-track .eq-switch-thumb {
    transform: translateX(16px);
    background: var(--text-on-accent);
}

.eq-switch-label {
    font-weight: 500;
}

.eq-preset-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.eq-preset-select:focus {
    border-color: var(--accent-primary);
}

.eq-reset-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.eq-reset-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.eq-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.eq-close-btn:hover {
    color: var(--text-primary);
    background: var(--overlay-selected);
}

/* ---- Band grid --------------------------------------------------- */
.eq-body {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 4px 4px;
}

.eq-modal.eq-disabled .eq-body {
    opacity: 0.55;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 44px;
    flex: 1;
}

.eq-preamp-band {
    flex: 1.1;
}

.eq-bands-divider {
    width: 1px;
    height: 220px;
    background: var(--border-subtle);
    margin: 0 6px;
    align-self: center;
}

.eq-band-value {
    font-size: 11px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-height: 14px;
    letter-spacing: 0.2px;
}

.eq-band-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    min-height: 14px;
}

.eq-preamp-band .eq-band-label {
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.6px;
}

/* ---- Vertical slider -------------------------------------------- */
.eq-slider-wrap {
    position: relative;
    height: 220px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The slider itself is rotated 270° so the native horizontal range control
   appears vertical. The wrap above holds its visual box; the slider is
   absolute-positioned and rotated inside it. */
.eq-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 220px;
    height: 28px;
    background: transparent;
    transform: rotate(-90deg);
    transform-origin: center center;
    position: absolute;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.eq-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-sidebar);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.eq-slider:hover::-webkit-slider-thumb {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(var(--accent-primary-rgb), 0.5);
}

.eq-slider:focus {
    outline: none;
}

.eq-slider:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.25);
}

.eq-preamp-slider::-webkit-slider-thumb {
    background: var(--accent-secondary);
}

.eq-preamp-slider:hover::-webkit-slider-thumb {
    box-shadow: 0 2px 8px rgba(var(--accent-secondary-rgb), 0.5);
}

/* Axis labels next to the preamp slider (the only one that shows a scale). */
.eq-slider-axis {
    position: absolute;
    right: -4px;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* Tick column — visual marks so users can see the slider is stepped
   (step=1dB). The preamp shows labels; band sliders show just lines. */
.eq-tick-col {
    position: absolute;
    right: -8px;
    top: 0;
    bottom: 0;
    width: 28px;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}
.eq-tick-col-compact {
    right: -4px;
    width: 10px;
}
.eq-tick {
    position: absolute;
    top: var(--tick-pos, 50%);
    transform: translateY(-50%);
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1;
    left: 0;
    padding-left: 6px;
}
.eq-tick::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 50%;
    width: 5px;
    height: 1px;
    background: var(--border-strong);
}
.eq-tick-mid::before {
    width: 8px;
    background: var(--border-strong);
}
.eq-tick-col-compact .eq-tick {
    font-size: 0;         /* no labels on band sliders */
    padding: 0;
}
.eq-tick-col-compact .eq-tick::before {
    left: 0;
    width: 4px;
}
.eq-tick-col-compact .eq-tick-mid::before {
    width: 6px;
}
