/* --- EQ Curve Visualizer (Modern & Technical) --- */
/* ========================================
   VISUAL CONTENT WRAPPER - New Layout
   ======================================== */
.visual-content-wrapper {
    display: flex;
    gap: var(--text-base);
}

.visual-left-group {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    gap: var(--text-base);
}

/* EQ Curve Container */
.eq-curve-container {
    width: 100%;
    margin: 0;
    padding: var(--text-base);
    position: relative;
    overflow: hidden;
}

/* EQ Curve Title (PEAK/LUFSスタイルに合わせる) */
.eq-curve-title {
    margin-bottom: var(--space-xs);
}

.eq-curve-title .label {
    font-size: 13px;
    /* .stat-labelと同じ */
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

/* EQ Frequency Labels are now drawn directly on canvas for logarithmic alignment */
#eq-curve-canvas {
    width: 100%;
    height: 315px;
    /* Slightly reduced height as per user request */
    display: block;
}

/* --- Dev Tools & Legend --- */
.dev-eq-legend {
    display: flex;
    gap: var(--radius-lg);
    margin-top: var(--radius-md);
    padding-top: 6px;
    border-top: 1px solid var(--border-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--radius-sm);
    font-size: var(--radius-md);
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.legend-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.preset-dot {
    background: var(--accent-primary);
}

.ref-dot {
    background: #10b981;
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Visualizer */
.visualizer-container {
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
    position: relative;
}

canvas {
    width: 100%;
    height: 100%;
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.progress-text {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--accent-primary);
    text-align: center;
}

/* --- EQ Visualizer Spacing --- */
.eq-bar-label-group {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 var(--radius-sm);
    margin-bottom: var(--radius-md);
    /* Space ABOVE bars */
}

/* Removed duplicate .eq-val-group that was overriding grid layout */

.eq-val {
    font-family: var(--font-mono);
    font-size: 10px;
    text-align: center;
    color: var(--text-muted);
    width: 33%;
}

.eq-val.boost {
    color: var(--success);
}

.eq-val.cut {
    color: #ef4444;
}

/* ... End of additions ... */

/* --- Manual EQ Controls (Horizontal above graph) --- */
.manual-eq-horizontal {
    display: flex;
    justify-content: space-between;
    gap: var(--text-xs);
    transition: opacity 0.3s ease;
}

.manual-eq-horizontal.is-disabled {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

.manual-eq-horizontal .eq-band-control {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--radius-sm);
    padding: var(--space-xs) var(--text-xs);
}

.eq-band-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.eq-gain-val {
    color: var(--text-muted);
    transition: color 0.15s ease;
}

/* Tweaking State - Visually highlight adjustment */
.eq-gain-val.is-tweaking {
    color: var(--accent-primary);
    text-shadow: 0 0 var(--radius-md) rgba(255, 255, 255, 0.4);
}


/* ========================================
   MASTERING ACTION HUB (v600 Refined)
   ======================================== */
.mastering-action-wrapper {
    padding: var(--text-base) var(--space-xl);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: var(--space-md);
}

/* REMOVED: .mastering-hub-btn::before and :hover::before to fix visual bugs */

/* .mastering-hub-btn moved to buttons.css as .btn-hub */

.hub-btn-content {
    display: flex;
    align-items: center;
    gap: var(--radius-lg);
    z-index: 2;
    transition: transform 0.3s ease;
}

.hub-btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
    filter: blur(20px);
    z-index: 1;
}

.mastering-hub-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    /* Unified with preset-card */
}

/* REMOVED: .mastering-hub-btn:hover .hub-btn-glow to fix visual bugs */

/* Fix for v4.7: Hide idle glow when in complete state to prevent flickering */
.mastering-hub-btn.complete:hover .hub-btn-glow {
    opacity: 0;
}

.mastering-hub-btn:active {
    transform: scale(0.98);
}

/* Processing State */
.mastering-hub-btn.processing {
    border-color: var(--border-primary);
    color: var(--text-secondary);
    cursor: wait;
    pointer-events: none;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.mastering-hub-btn.processing .btn-icon {
    animation: hub-pulse 2s infinite;
}

/* Complete State (Download) v4.9: Brighter Solid & Controlled Hover */
.mastering-hub-btn.complete {
    border: none;
    background: color-mix(in srgb, var(--preset-active-color, var(--success)), black 15%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    /* Darker shadow */
    text-shadow: none;
}

.mastering-hub-btn.complete .processing-spinner {
    background: color-mix(in srgb, var(--preset-active-color, var(--success)), black 40%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    /* Use darker shadow instead of white glow */
}

.mastering-hub-btn.complete .btn-icon svg {
    stroke: #fff;
}

.mastering-hub-btn.complete:hover {
    background: color-mix(in srgb, var(--preset-active-color, var(--success)), black 5%);
    border-color: rgba(255, 255, 255, 0.3);
}

.processing-spinner {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 3;
    box-shadow: 0 0 10px var(--accent-primary);
}

@keyframes hub-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

.eq-slider.is-tweaking::-webkit-slider-thumb {
    background: var(--accent-primary);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.eq-slider {
    transition: filter 0.2s ease;
}

.eq-slider:hover {
    filter: brightness(1.2);
}