/* ═══════════════════════════════════════════════════════════════════════════
   MAESTRO v0.1.7 - ENHANCED CRITICAL FAILURE CARD
   With YELLOW FLASHING LED, System Tuning, and Alert Escalation
   ═══════════════════════════════════════════════════════════════════════════ */

/* TEST NUMBER DISPLAY - Large, prominent */
.fail-fast-test-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #ff3333;
    text-align: center;
    margin: 10px 0;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255,51,51,0.5);
}

/* SYSTEM TUNING SECTION */
.system-tuning-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #444;
    border-radius: 8px;
}

.tuning-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tuning-led {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #666;
    background: #333;
    transition: all 0.3s ease;
}

/* LED STATES */
/* Yellow flashing - Failure detected, awaiting action */
.tuning-led.yellow-flash {
    background: #ffcc00;
    border-color: #ffcc00;
    box-shadow: 0 0 15px #ffcc00, 0 0 30px rgba(255,204,0,0.5);
    animation: yellowFlash 0.5s ease-in-out infinite;
}

@keyframes yellowFlash {
    0%, 100% { opacity: 1; box-shadow: 0 0 15px #ffcc00, 0 0 30px rgba(255,204,0,0.5); }
    50% { opacity: 0.4; box-shadow: 0 0 5px #ffcc00; }
}

/* Orange pulsing - Agents working on repair */
.tuning-led.orange-pulse {
    background: #ff8800;
    border-color: #ff8800;
    box-shadow: 0 0 15px #ff8800;
    animation: orangePulse 1s ease-in-out infinite;
}

@keyframes orangePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px #ff8800; }
    50% { transform: scale(1.1); box-shadow: 0 0 25px #ff8800, 0 0 40px rgba(255,136,0,0.5); }
}

/* Red fast flash - Multi-node failure, escalated */
.tuning-led.red-flash {
    background: #ff3333;
    border-color: #ff3333;
    box-shadow: 0 0 20px #ff3333;
    animation: redFastFlash 0.25s ease-in-out infinite;
}

@keyframes redFastFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Green glow - Repair complete */
.tuning-led.green-glow {
    background: #00ff66;
    border-color: #00ff66;
    box-shadow: 0 0 20px #00ff66, 0 0 40px rgba(0,255,102,0.5);
    animation: greenGlow 2s ease-in-out infinite;
}

@keyframes greenGlow {
    0%, 100% { box-shadow: 0 0 20px #00ff66, 0 0 40px rgba(0,255,102,0.5); }
    50% { box-shadow: 0 0 30px #00ff66, 0 0 60px rgba(0,255,102,0.7); }
}

/* Dark - Initial state or repair complete */
.tuning-led.dark {
    background: #333;
    border-color: #555;
    box-shadow: none;
    animation: none;
}

.tuning-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #aaa;
    letter-spacing: 1px;
}

.tuning-status {
    margin-left: auto;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

/* Tuning Progress Bar */
.tuning-progress {
    margin-top: 15px;
}

.tuning-agent {
    font-size: 0.85rem;
    color: #ffcc00;
    margin-bottom: 8px;
}

.tuning-bar {
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
}

.tuning-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #ff8800);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* BUTTON STYLES */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.button-row:last-child {
    margin-bottom: 0;
}

/* Repair button */
.fail-fast-btn.repair-btn {
    background: linear-gradient(135deg, #00aaff 0%, #0077cc 100%);
    border: 2px solid #00aaff;
    color: #fff;
}

.fail-fast-btn.repair-btn:hover {
    background: linear-gradient(135deg, #00ccff 0%, #0099ee 100%);
    box-shadow: 0 0 15px rgba(0,170,255,0.5);
}

/* System Tuning button with LED */
.fail-fast-btn.tuning-btn {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #ffcc00;
    color: #ffcc00;
    position: relative;
    padding-left: 35px;
}

.fail-fast-btn.tuning-btn .btn-led {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffcc00;
    animation: yellowFlash 0.5s ease-in-out infinite;
}

.fail-fast-btn.tuning-btn:disabled {
    border-color: #666;
    color: #666;
}

.fail-fast-btn.tuning-btn:disabled .btn-led {
    background: #444;
    animation: none;
}

/* Recheck button - disabled until repair complete */
.fail-fast-btn.recheck-btn {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 2px solid #444;
    color: #444;
    cursor: not-allowed;
}

.fail-fast-btn.recheck-btn:not(:disabled) {
    background: linear-gradient(135deg, #00cc66 0%, #009944 100%);
    border-color: #00ff66;
    color: #fff;
    cursor: pointer;
    animation: recheckReady 1s ease-in-out infinite;
}

@keyframes recheckReady {
    0%, 100% { box-shadow: 0 0 10px rgba(0,255,102,0.3); }
    50% { box-shadow: 0 0 25px rgba(0,255,102,0.7); }
}

.fail-fast-btn.recheck-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #00ee77 0%, #00bb55 100%);
    box-shadow: 0 0 30px rgba(0,255,102,0.8);
}

/* ALERT ESCALATION STATES */
.fail-fast-alert.alert-yellow {
    border-color: #ffcc00;
    box-shadow: 0 0 30px rgba(255,204,0,0.3);
}

.fail-fast-alert.alert-orange {
    border-color: #ff8800;
    box-shadow: 0 0 40px rgba(255,136,0,0.4);
}

.fail-fast-alert.alert-red {
    border-color: #ff3333;
    box-shadow: 0 0 50px rgba(255,51,51,0.5);
    animation: redAlertPulse 0.5s ease-in-out infinite;
}

@keyframes redAlertPulse {
    0%, 100% { box-shadow: 0 0 50px rgba(255,51,51,0.5); }
    50% { box-shadow: 0 0 80px rgba(255,51,51,0.8); }
}

.fail-fast-alert.alert-critical {
    border-color: #ff0000;
    background: linear-gradient(135deg, rgba(255,0,0,0.2) 0%, rgba(139,0,0,0.3) 100%);
    animation: criticalFlash 0.25s ease-in-out infinite;
}

@keyframes criticalFlash {
    0%, 100% { 
        box-shadow: 0 0 60px rgba(255,0,0,0.6);
        background: linear-gradient(135deg, rgba(255,0,0,0.2) 0%, rgba(139,0,0,0.3) 100%);
    }
    50% { 
        box-shadow: 0 0 100px rgba(255,0,0,1);
        background: linear-gradient(135deg, rgba(255,0,0,0.4) 0%, rgba(139,0,0,0.5) 100%);
    }
}
