/* HoFa (Hold & Fade) Module CSS - Uses Global WebSynth Components */

/* ===== Module Structure ===== */
.hofa-component-container {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}

.hofa-component {
    margin-bottom: 15px;
    text-align: center;
}

/* ===== Spacing ===== */
.hofa-space5 { height: 5px; }
.hofa-space10 { height: 10px; }
.hofa-space20 { height: 20px; }

/* ===== Sliders ===== */
.hofa-slider-container {
    position: relative;
    margin-bottom: 8px;
}

.hofa-slider-container input[type="range"] {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.hofa-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

.hofa-slider-container input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.hofa-slider-value {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #FFF;
    background: rgba(0,0,0,0.7);
    padding: 2px 5px;
    border-radius: 3px;
    margin-top: 4px;
    min-width: 45px;
    display: inline-block;
}

/* ===== Labels ===== */
.hofa-labels-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: #999;
    margin-top: 4px;
}

.hofa-label-min, .hofa-label-max {
    font-size: 8px;
    opacity: 0.7;
}

.hofa-label-title {
    font-weight: bold;
    color: #FFF;
    font-size: 10px;
}

/* ===== Audio Patching Field (VCA Style) ===== */
.hofa-patching-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    height: 25px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    font-size: 12px;
    color: #999;
}

.hofa-patching-field input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    color: #ccc;
    width: 100%;
    font-weight: bold;
}

.hofa-patching-field input::placeholder {
    color: #666;
}

.hofa-patch-connection-indicator {
    width: 8px;
    height: 8px;
    background: gray;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

.hofa-patch-connection-indicator.connected {
    background: #06F838;
}

.hofa-patch-connection-indicator.invalid {
    background: red;
}

.hofa-label-field {
    font-size: 12px;
    font-weight: bold;
    color: #999;
    margin-bottom: 4px;
    display: block;
}

/* ===== CV Field (VCA Style) ===== */
.hofa-cv-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    height: 25px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    font-size: 12px;
    color: #999;
}

.hofa-cv-field input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    color: #ccc;
    width: 100%;
    font-weight: bold;
}

.hofa-cv-field input::placeholder {
    color: #666;
}

.hofa-cv-connection-indicator {
    width: 8px;
    height: 8px;
    background: gray;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

.hofa-cv-connection-indicator.connected {
    background: #06F838;
}

.hofa-cv-connection-indicator.invalid {
    background: red;
}

/* ===== Status LEDs ===== */
.hofa-status-line {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 10px 0;
    gap: 12px;
}

.hofa-status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
    text-align: center;
}

.status-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    transition: all 0.2s ease;
}

.status-led.active {
    background: #4CAF50;
    border-color: #4CAF50;
    box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.status-led.connected {
    background: #4CAF50;
    border-color: #4CAF50;
    opacity: 0.6;
}

.status-led.invalid {
    background: #f44336;
    border-color: #f44336;
    box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}

.hofa-status-label {
    font-size: 8px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hofa-patching-LED-active {
    font-size: 9px;
    color: #999;
    text-align: center;
}

.hofa-patching-LED-active {
    background: #FF5722;
    border-color: #FF5722;
    color: #FFF;
}

.hofa-cv-connection-indicator.invalid {
    background: #ff4444;
    box-shadow: 0 0 6px rgba(255, 68, 68, 0.8);
}

/* ===== Status Row ===== */
.hofa-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hofa-status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.status-label {
    font-size: 8px;
    font-weight: bold;
    color: #666;
    letter-spacing: 0.5px;
}

/* ===== Status LEDs ===== */
.hofa-input-led,
.hofa-hold-led,
.hofa-fade-led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    transition: all 0.3s;
}

/* Input LED - Green when audio detected */
.hofa-input-led.active {
    background: #06F838;
    border-color: #06F838;
    box-shadow: 0 0 8px rgba(6, 248, 56, 0.6);
}

/* Hold LED - Yellow when holding */
.hofa-hold-led.active {
    background: #ffaa00;
    border-color: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.6);
}

/* Fade LED - Red when fading */
.hofa-fade-led.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

/* ===== Control Row (Button + LED) ===== */
.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ===== Slider Value Displays ===== */
.hofa-threshold-display {
    color: #ff8800 !important;
}

.hofa-hold-display {
    color: #ffaa00 !important;
}

.hofa-fade-display {
    color: #ff6b6b !important;
}

/* ===== Slider Styling ===== */
.hofa-threshold-slider,
.hofa-hold-slider,
.hofa-fade-slider {
    width: 100%;
    height: 6px;
    background: #333;
    outline: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Webkit browsers slider track */
.hofa-threshold-slider::-webkit-slider-track,
.hofa-hold-slider::-webkit-slider-track,
.hofa-fade-slider::-webkit-slider-track {
    height: 6px;
    background: #333;
    border-radius: 3px;
}

/* Webkit browsers thumb */
.hofa-threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff8800;
    border: 2px solid #ff8800;
    cursor: pointer;
    margin-top: -4px;
    transition: background 0.2s;
}

.hofa-hold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffaa00;
    border: 2px solid #ffaa00;
    cursor: pointer;
    margin-top: -4px;
    transition: background 0.2s;
}

.hofa-fade-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff6b6b;
    border: 2px solid #ff6b6b;
    cursor: pointer;
    margin-top: -4px;
    transition: background 0.2s;
}

.hofa-threshold-slider::-webkit-slider-thumb:hover {
    background: #ffaa00;
}

.hofa-hold-slider::-webkit-slider-thumb:hover {
    background: #ffcc33;
}

.hofa-fade-slider::-webkit-slider-thumb:hover {
    background: #ff8888;
}

/* Firefox slider track */
.hofa-threshold-slider::-moz-range-track,
.hofa-hold-slider::-moz-range-track,
.hofa-fade-slider::-moz-range-track {
    height: 6px;
    background: #333;
    border-radius: 3px;
}

/* Firefox thumb */
.hofa-threshold-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff8800;
    border: 2px solid #ff8800;
    cursor: pointer;
    transition: background 0.2s;
}

.hofa-hold-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffaa00;
    border: 2px solid #ffaa00;
    cursor: pointer;
    transition: background 0.2s;
}

.hofa-fade-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff6b6b;
    border: 2px solid #ff6b6b;
    cursor: pointer;
    transition: background 0.2s;
}

.hofa-threshold-slider::-moz-range-thumb:hover {
    background: #ffaa00;
}

.hofa-hold-slider::-moz-range-thumb:hover {
    background: #ffcc33;
}

.hofa-fade-slider::-moz-range-thumb:hover {
    background: #ff8888;
}

/* ===== Module Specific Animations ===== */
@keyframes hofaHoldPulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes hofaFadePulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.hofa-hold-led.active {
    animation: hofaHoldPulse 1.5s ease-in-out infinite;
}

.hofa-fade-led.active {
    animation: hofaFadePulse 1s ease-in-out infinite;
}

/* ===== Responsive Design ===== */
@media (max-width: 300px) {
    .hofa-status-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .hofa-status-item {
        flex-direction: row;
        gap: 8px;
    }
    
    .hofa-component-container {
        padding: 15px;
    }
}