/* Limiter effect styling - Professional Edition.
 *
 * This template is not currently wired into the live effects panel (no
 * limiter entry in js/wavetablesynth/html-template.js, no limiter DSP
 * module under js/effects/), so nothing here renders today. Converted for
 * consistency anyway, EXCEPT the gain-reduction meter's green->yellow->red
 * gradient and the clip/emergency-button reds below, which are left in
 * color and called out in the greyscale pass's report: a live meter like
 * this is the one place a color genuinely reads faster than its adjacent
 * number, the way it does on real hardware. If this is ever wired up,
 * revisit that choice deliberately rather than inheriting it by accident. */

.limiter-section {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Professional features badge */
.limiter-features {
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.limiter-pro-badge {
    background-color: #838383;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.limiter-features small {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: 0.3px;
}

.limiter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.limiter-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.limiter-label {
    font-size: 12px;
    width: 100px;
}

.limiter-value {
    font-size: 12px;
    width: 50px;
    text-align: right;
}

.limiter-adaptive-value {
    font-size: 12px;
    width: 50px;
    text-align: right;
    color: #838383;
    font-weight: bold;
}

/* Gain reduction meter styling */
.limiter-meter-container {
    width: 100%;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.limiter-gain-reduction-meter {
    width: 0%; /* Updated dynamically with JS */
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 255, 0, 0.7) 0%, 
        rgba(255, 255, 0, 0.7) 50%, 
        rgba(255, 0, 0, 0.7) 100%);
    border-radius: 3px;
    transition: width 0.1s ease-out;
    position: relative;
    box-shadow: 0 0 5px rgba(0,255,0,0.3);
}

.limiter-gain-reduction-meter::after {
    content: attr(data-value);
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.7);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

/* Tick marks to show dB levels */
.limiter-meter-ticks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    pointer-events: none;
}

.limiter-meter-tick {
    position: relative;
    height: 100%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.5);
}

.limiter-meter-tick::after {
    content: attr(data-db);
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* Clip indicator */
.limiter-clip-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #333;
    margin-left: 10px;
    transition: all 0.1s ease;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
}

.limiter-clip-indicator.clipping {
    background-color: #f00;
    box-shadow: 0 0 10px #f00;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Enable/disable switch */
.limiter-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.limiter-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.limiter-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.limiter-switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

input:checked + .limiter-switch-slider {
    background-color: #7e7e7e;
}

input:checked + .limiter-switch-slider:before {
    transform: translateX(20px);
}

/* Custom range slider styling */
.limiter-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.limiter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #878787;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.limiter-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #878787;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Each slider used a different accent to tell them apart at a glance, but
   the label to their left already names them (Threshold/Release/etc), so
   they now share the one neutral thumb color too. */
.limiter-threshold-slider::-webkit-slider-thumb {
    background: #878787;
}

.limiter-threshold-slider::-moz-range-thumb {
    background: #878787;
}

.limiter-release-slider::-webkit-slider-thumb {
    background: #878787;
}

.limiter-release-slider::-moz-range-thumb {
    background: #878787;
}

/* Dropdown select styling */
.limiter-select {
    appearance: none;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
    width: 100px;
    font-size: 12px;
    background-image: linear-gradient(45deg, transparent 50%, #555 50%), 
                     linear-gradient(135deg, #555 50%, transparent 50%);
    background-position: calc(100% - 15px) center, calc(100% - 10px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
    outline: none;
}

.limiter-select:focus {
    border-color: #7e7e7e;
    box-shadow: 0 0 3px rgba(126, 126, 126, 0.3);
}

/* Adaptive release info styling */
#adaptiveReleaseInfo {
    background-color: rgba(0,0,0,0.03);
    padding: 5px;
    border-radius: 4px;
    border-left: 3px solid #838383;
    margin-top: 5px;
}

/* Add a glow effect when clipping occurs to the entire panel */
.fx-section[data-effect="limiter"].clipping {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    transition: box-shadow 0.2s;
}

/* Emergency anti-clipping button */
.limiter-emergency-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.limiter-emergency-button {
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.4);
    width: 100%;
    text-align: center;
    letter-spacing: 0.5px;
}

.limiter-emergency-button:hover {
    background-color: #cc0000;
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.6);
    transform: translateY(-1px);
}

.limiter-emergency-button:active {
    background-color: #990000;
    box-shadow: 0 1px 2px rgba(255, 0, 0, 0.4);
    transform: translateY(1px);
}

.limiter-emergency-desc {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    text-align: center;
} 