/* ===========================================
   EQUALIZER - Professional 10-Band EQ + Preamp
   Panel dropdown (no modal, no bloqueo)
   =========================================== */

/* --- Panel Dropdown --- */
.eq-panel {
    position: fixed;
    width: 340px;
    max-width: 95vw;
    background: linear-gradient(145deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 12px;
    box-shadow:
        0 0 8px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(99, 102, 241, 0.25),
        0 0 40px rgba(99, 102, 241, 0.15),
        0 0 80px rgba(99, 102, 241, 0.08),
        inset 0 0 12px rgba(99, 102, 241, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.eq-panel.eq-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Header --- */
.eq-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
}

.eq-title svg {
    width: 14px;
    height: 14px;
    color: #6366f1;
}

/* --- Toggle ON/OFF --- */
.eq-toggle {
    position: relative;
    width: 34px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.eq-toggle.eq-active {
    background: #6366f1;
}

.eq-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.eq-toggle.eq-active .eq-toggle-knob {
    transform: translateX(16px);
}

.eq-close-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    background: none;
    border: none;
    margin-left: auto;
    flex-shrink: 0;
}

.eq-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* --- Presets & Controls Bar --- */
.eq-controls-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Custom Dropdown Presets --- */
.eq-dd-wrapper {
    position: relative;
}

.eq-dd-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: #fff;
    padding: 3px 6px;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}

.eq-dd-btn svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.eq-dd-list {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 3px;
    background: #0f0f1e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    min-width: 130px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
}

.eq-dd-list::-webkit-scrollbar {
    width: 4px;
}

.eq-dd-list::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 2px;
}

.eq-dd-list.eq-dd-open {
    display: block;
}

.eq-dd-item {
    padding: 5px 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    white-space: nowrap;
}

.eq-dd-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.eq-dd-item.eq-dd-active {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.08);
}

.eq-btn-reset {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.6);
    padding: 3px 8px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.eq-btn-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* --- Canvas de respuesta de frecuencia --- */
.eq-canvas-wrapper {
    padding: 2px 8px;
    height: 40px;
}

.eq-canvas {
    width: 100%;
    height: 36px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
}

/* --- Cuerpo del EQ: Preamp + Bandas --- */
.eq-body {
    display: flex;
    gap: 0;
    padding: 5px 6px 8px;
}

/* --- Preamp Section --- */
.eq-preamp-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 30px;
    padding-right: 5px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 5px;
    flex-shrink: 0;
}

.eq-preamp-label {
    font-size: 8px;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.eq-preamp-value {
    font-size: 9px;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 3px;
    min-width: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

/* --- Bandas Container --- */
.eq-bands-container {
    display: flex;
    gap: 0;
    flex: 1;
    justify-content: space-between;
    min-width: 0;
}

/* --- Banda Individual --- */
.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.eq-band-freq {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
}

.eq-band-value {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    margin-top: 2px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

/* --- Número y dB separados --- */
.eq-val-num {
    display: block;
}

.eq-val-db {
    display: block;
    font-size: 7px;
    opacity: 0.7;
    margin-top: 1px;
}

/* --- Slider Vertical --- */
.eq-slider-track {
    position: relative;
    width: 4px;
    height: 90px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    cursor: pointer;
    touch-action: none;
}

.eq-slider-fill {
    position: absolute;
    bottom: 50%;
    left: 0;
    width: 100%;
    border-radius: 3px;
    will-change: height;
}

.eq-slider-fill.eq-fill-positive {
    background: linear-gradient(to top, #6366f1, #818cf8);
}

.eq-slider-fill.eq-fill-negative {
    top: 50%;
    bottom: auto;
    background: linear-gradient(to bottom, #6366f1, #4f46e5);
}

/* Linea central (0 dB) */
.eq-slider-center {
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-0.5px);
}

/* Marcas de escala */
.eq-slider-mark {
    position: absolute;
    left: -1px;
    right: -1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

/* Thumb del slider */
.eq-slider-thumb {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 7px;
    background: linear-gradient(180deg, #e0e0e0 0%, #b0b0b0 100%);
    border-radius: 2px;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 2;
    will-change: top;
}

.eq-slider-thumb:active,
.eq-slider-thumb.eq-dragging {
    cursor: grabbing;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.7), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Preamp slider - color diferente */
.eq-preamp-section .eq-slider-fill.eq-fill-positive {
    background: linear-gradient(to top, #f59e0b, #fbbf24);
}

.eq-preamp-section .eq-slider-fill.eq-fill-negative {
    background: linear-gradient(to bottom, #f59e0b, #d97706);
}

/* --- EQ inline header (texto + toggle) --- */
.eq-header-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    flex-shrink: 0;
}

.eq-label-btn {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.eq-label-btn:hover {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
}

.eq-label-btn.eq-btn-active {
    color: #818cf8;
}

/* --- dB labels laterales --- */
.eq-db-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 90px;
    padding-right: 2px;
    flex-shrink: 0;
    margin-right: 2px;
}

.eq-db-label {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.25);
    text-align: right;
    line-height: 1;
    min-width: 16px;
}

/* --- Responsive Mobile --- */
@media (max-width: 360px) {
    .eq-panel {
        width: 95vw;
    }

    .eq-slider-track {
        height: 75px;
    }

    .eq-db-labels {
        height: 75px;
    }

    .eq-body {
        padding: 4px 4px 6px;
    }
}
