/*
   Launch Code Simulation Styling
   Vintage LED/Diode Character Display Effects
   Wargames Movie Recreation
*/

/* Override body for this specific page */
body {
    background: #000;
    color: #ff4500; /* Orange-red for danger/alert theme */
    min-height: 100vh; /* Ensure minimum height but allow scrolling */
    overflow-y: auto; /* Explicitly enable vertical scrolling */
}

/* Launch Display Container */
.launch-display {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff4500;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    position: relative;
}

.launch-display::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff4500, #ff6600, #ff4500);
    border-radius: 10px;
    z-index: -1;
    animation: borderPulse 2s infinite;
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Display Header */
.display-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #ff4500;
    padding-bottom: 15px;
}

.code-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: #ff4500;
    text-shadow: 0 0 15px #ff4500;
    letter-spacing: 0.2em;
    margin-bottom: 15px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 15px #ff4500; }
    50% { text-shadow: 0 0 25px #ff4500, 0 0 35px #ff4500; }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #ffaa00;
}

.attempts-counter {
    color: #ffff00;
}

.status-indicator {
    color: #ff4500;
    animation: statusBlink 1.5s infinite;
}

@keyframes statusBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Diode Container - Main Display */
.diode-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    perspective: 1000px;
}

.diode-display {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 
        inset 0 0 20px rgba(255, 69, 0, 0.1),
        0 0 30px rgba(255, 69, 0, 0.3);
}

/* Individual Diode Position */
.diode-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Diode Character - The main LED display */
.diode-character {
    width: 60px;
    height: 80px;
    background: #000;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff4500;
    text-shadow: 
        0 0 10px #ff4500,
        0 0 20px #ff4500,
        0 0 30px #ff4500;
    box-shadow: 
        inset 0 0 10px rgba(255, 69, 0, 0.2),
        0 0 15px rgba(255, 69, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Scanning animation for active characters */
.diode-character.scanning {
    animation: characterScan 0.8s ease-in-out;
    border-color: #ff6600;
}

@keyframes characterScan {
    0% { 
        color: #ff4500;
        text-shadow: 0 0 10px #ff4500;
        transform: scale(1);
    }
    50% { 
        color: #ffff00;
        text-shadow: 
            0 0 15px #ffff00,
            0 0 25px #ffff00,
            0 0 35px #ffff00;
        transform: scale(1.1);
    }
    100% { 
        color: #ff4500;
        text-shadow: 0 0 10px #ff4500;
        transform: scale(1);
    }
}

/* Locked character - when correct character is found */
.diode-character.locked {
    color: #00ff00 !important;
    text-shadow: 
        0 0 15px #00ff00,
        0 0 25px #00ff00,
        0 0 35px #00ff00 !important;
    border-color: #00ff00;
    box-shadow: 
        inset 0 0 15px rgba(0, 255, 0, 0.3),
        0 0 25px rgba(0, 255, 0, 0.6);
    animation: lockSuccess 1s ease-in-out;
}

@keyframes lockSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* LED glow effect overlay */
.diode-character::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    border-radius: 6px;
    pointer-events: none;
}

/* Position labels */
.position-label {
    font-family: 'VT323', monospace;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

/* Target Code Display */
.target-code-display {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    border-radius: 10px;
    animation: finalCodeReveal 2s ease-in-out;
}

@keyframes finalCodeReveal {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.target-code-display h4 {
    font-family: 'Orbitron', monospace;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
    margin-bottom: 15px;
}

.final-code {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: #00ff00;
    text-shadow: 
        0 0 20px #00ff00,
        0 0 30px #00ff00,
        0 0 40px #00ff00;
    letter-spacing: 0.3em;
    animation: finalCodeGlow 2s ease-in-out infinite;
}

@keyframes finalCodeGlow {
    0%, 100% { 
        text-shadow: 
            0 0 20px #00ff00,
            0 0 30px #00ff00,
            0 0 40px #00ff00;
    }
    50% { 
        text-shadow: 
            0 0 30px #00ff00,
            0 0 50px #00ff00,
            0 0 70px #00ff00;
    }
}

/* Control Panel */
.control-panel {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #666;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    color: #ffaa00;
    display: block;
    margin-bottom: 10px;
}

.form-range {
    background: #333;
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    background: #ff4500;
    box-shadow: 0 0 10px #ff4500;
}

#difficultyValue {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    color: #ff4500;
    margin-left: 15px;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-buttons .btn {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    text-shadow: 0 0 5px currentColor;
    border: 2px solid currentColor;
    transition: all 0.3s ease;
}

.control-buttons .btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px currentColor;
}

.btn-danger {
    background: rgba(220, 53, 69, 0.2) !important;
    border-color: #dc3545 !important;
    color: #dc3545 !important;
}

.btn-warning {
    background: rgba(255, 193, 7, 0.2) !important;
    border-color: #ffc107 !important;
    color: #ffc107 !important;
}

.btn-secondary {
    background: rgba(108, 117, 125, 0.2) !important;
    border-color: #6c757d !important;
    color: #6c757d !important;
}

/* Status Messages */
.status-messages {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    max-height: 120px;
    overflow-y: auto;
}

.status-line {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    color: #ffaa00;
    margin-bottom: 5px;
    animation: fadeInLine 0.5s ease-in;
}

@keyframes fadeInLine {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Navigation Panel */
.navigation-panel {
    text-align: center;
}

.nav-buttons .btn {
    font-family: 'VT323', monospace;
    font-size: 1.1rem;
    text-shadow: 0 0 5px currentColor;
    transition: all 0.3s ease;
}

.btn-outline-success {
    border: 2px solid #00ff00;
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.btn-outline-success:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px #00ff00;
    transform: scale(1.05);
    border-color: #00ff00;
    color: #00ff00;
}

.btn-outline-warning {
    border: 2px solid #ffc107;
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.btn-outline-warning:hover {
    background: rgba(255, 193, 7, 0.2);
    box-shadow: 0 0 15px #ffc107;
    transform: scale(1.05);
    border-color: #ffc107;
    color: #ffc107;
}

/* Responsive Design */
@media (max-width: 768px) {
    .diode-display {
        gap: 8px;
        padding: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .diode-character {
        width: 45px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .code-title {
        font-size: 1.4rem;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Success state for entire display */
.launch-display.success {
    border-color: #00ff00;
    background: rgba(0, 50, 0, 0.9);
}

.launch-display.success::before {
    background: linear-gradient(45deg, #00ff00, #00aa00, #00ff00);
}

/* Alert state for dangerous operations */
.launch-display.alert {
    animation: dangerPulse 1s infinite;
}

@keyframes dangerPulse {
    0%, 100% { 
        border-color: #ff4500;
        box-shadow: 0 0 20px rgba(255, 69, 0, 0.3);
    }
    50% { 
        border-color: #ff0000;
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    }
}