/* ========================= BASE / LAYOUT GENERAL ========================= */

body {
    background: #1a1a1a;
    font-family: "Courier New", monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #e6e6d6;
    position: relative;
    padding: 0 160px;
}

/* ========================= PANEL PRINCIPAL ========================= */

.panel {
    width: 680px;
    background: linear-gradient(145deg, #2b2b2b, #1c1c1c);
    border: 3px solid #555;
    padding: 20px;
    box-shadow: inset 0 0 10px #000, 0 0 15px rgba(0,0,0,0.6);
}

.config-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #111;
    border: 2px solid #444;
    padding: 10px;
    color: #c9c3a5;
    font-family: "Courier New", monospace;
    width: 200px;
}

.config-panel input {
    width: 100%;
    margin-bottom: 10px;
    background: #222;
    border: 1px solid #444;
    color: white;
}

.config-hidden {
    display: none;
}

/* ========================= TIPOGRAFÍA ========================= */

h1 {
    text-align: center;
    color: #d8d2b0;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

/* ========================= SECCIONES GENERALES ========================= */

.section {
    background: #222;
    border: 1px solid #444;
    margin: 10px 0;
    padding: 12px;
    box-shadow: inset 0 0 5px #000;
}

/* ========================= BOTONES GENERALES ========================= */

button {
    background: linear-gradient(#3a3a3a, #2a2a2a);
    border: 2px solid #666;
    color: #e6e6d6;
    padding: 6px 10px;
    margin: 3px;
    cursor: pointer;
    font-family: "Courier New", monospace;
    box-shadow: inset 0 1px 0 #777, 0 2px 0 #111;
}

button:hover {
    background: #444;
}

button:active {
    transform: translateY(1px);
    box-shadow: inset 0 0 5px #000;
}

/* ========================= TOP CONTROLS ========================= */

.top-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* SCRAM BUTTON */

.scram {
    background: linear-gradient(#7a0000, #4a0000);
    border: 2px solid #aa3333;
    color: white;
    font-weight: bold;
}

/* ========================= DISPLAY BOXES ========================= */

#tempDisplay,
#waterDisplay,
#rodDisplay {
    background: #111;
    border: 1px solid #444;
    padding: 6px;
    display: inline-block;
    min-width: 250px;
    box-shadow: inset 0 0 4px #000;
}

/* ========================= ROD SYSTEM ========================= */

.rod-section h2 {
    margin-bottom: 10px;
    color: #c9c3a5;
    font-size: 14px;
}

.rod-layout {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.rod-info {
    flex: 1;
}

.rod-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.rod-system {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ROD VISUAL */

.rod-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rod-scale {
    width: 6px;
    height: 140px;
    background: repeating-linear-gradient(
        to bottom,
        #666 0px,
        #666 2px,
        transparent 2px,
        transparent 10px
    );
    box-shadow: inset 0 0 3px #000;
}

.rod-blue {
    width: 40px;
    height: 140px;
    background: #bbbbbb;
    border: 2px solid #000;
    position: relative;
    overflow: hidden;
}

.rod-white {
    width: 100%;
    height: 140px;
    background: #1e60a2;
    position: absolute;
    top: 0;
    transition: transform 0.3s ease-in-out;
}

/* ========================= SYSTEMS (COOLANT / FEEDWATER) ========================= */

.system-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.system-item {
    flex: 1;
    background: #1b1b1b;
    border: 1px solid #444;
    padding: 10px;
    text-align: center;
}

.system-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #c9c3a5;
}

/* LIGHTS */

.light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: red;
    box-shadow: 0 0 8px red;
    transition: all 0.3s ease;
}

.light.on {
    background: lime;
    box-shadow: 0 0 10px lime;
}

/* ========================= STATUS PANEL (RIGHT) ========================= */

.status-panel {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    background: #111;
    border: 2px solid #444;
    padding: 10px;
    color: #c9c3a5;
}

.status-panel h2 {
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
}

.status-item {
    padding: 6px;
    margin: 4px 0;
    text-align: center;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #555555;
}

/* STATES */

.status-active {
    color: black;
    font-weight: bold;
    background: lime;
    box-shadow: 0 0 10px lime;
}

.status-meltdown {
    background: red;
    color: white;
    box-shadow: 0 0 12px red;
}

.status-scram {
    background: #1e90ff;
    color: white;
    box-shadow: 0 0 10px #1e90ff;
}

.status-stalled {
    background: #0b3d91;
    color: white;
    animation: stalledBlink 0.8s infinite;
    box-shadow: 0 0 10px #3fa9ff;
}

@keyframes stalledBlink {
    0%, 100% {
        background: #0b3d91;
        box-shadow: 0 0 5px #3fa9ff;
    }
    50% {
        background: #1e90ff;
        box-shadow: 0 0 15px #3fa9ff;
    }
}

/* ========================= WARNING / DANGER / SAFE MODES ========================= */

.panel.warning-mode {
    border-color: orange;
    box-shadow: 0 0 20px orange;
    animation: warningPulse 1s infinite;
}

.panel.danger-mode {
    border-color: red;
    box-shadow: 0 0 25px red;
    animation: dangerPulse 0.5s infinite;
}

.panel.safe-mode {
    border-color: lime;
    box-shadow: 0 0 15px lime;
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 0 10px orange;
    }
    50% {
        box-shadow: 0 0 25px orange;
    }
}

@keyframes dangerPulse {
    0%, 100% {
        box-shadow: 0 0 10px red;
    }
    50% {
        box-shadow: 0 0 35px red;
    }
}

/* ========================= MELTDOWN BACKGROUND ========================= */

.panel.meltdown-mode {
    border-color: #ff0000;
    box-shadow: 0 0 25px orange;
    animation: meltdownPulse 0.6s infinite;
}

@keyframes meltdownBg {
    0% {
        background: #2a1200;
    }
    50% {
        background: #3a1a00;
    }
    100% {
        background: #2a1200;
    }
}

@keyframes meltdownPulse {
    0% {
        box-shadow: 0 0 10px orange;
    }
    50% {
        box-shadow: 0 0 30px orange;
    }
    100% {
        box-shadow: 0 0 10px orange;
    }
}

/* ========================= SCRAM STATES ========================= */

.scram-off {
    background: #222;
    color: #777;
}

.scram-ready {
    animation: scramBlink 0.5s infinite;
}

@keyframes scramBlink {
    0%, 100% {
        background: #7a0000;
        box-shadow: 0 0 5px red;
    }
    50% {
        background: red;
        box-shadow: 0 0 20px red;
    }
}

/* ========================= VALVES (LEFT CASCADE PANEL) ========================= */

.valve-panel {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 140px;
    background: #111;
    border: 2px solid #444;
    padding: 10px;
    text-align: center;
}

.valves-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.valves-vertical button {
    width: 100%;
}

.meltdown-timer {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    border: 2px solid red;
    color: #d8d2b0;
    padding: 8px 16px;
    font-family: "Courier New", monospace;
    font-weight: bold;
    box-shadow: 0 0 10px red;
    z-index: 999;
}

.hidden {
    display: none;
}

#volumeControl {
    width: 10%;
    margin-top: 6px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

/* TRACK */
#volumeControl::-webkit-slider-runnable-track {
    height: 6px;
    background: #222;
    border: 1px solid #555;
    box-shadow: inset 0 0 4px #000;
}

/* THUMB */
#volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #c9c3a5;
    border: 2px solid #444;
    box-shadow: 0 0 5px #000;
    cursor: pointer;
    margin-top: -5px;
}

/* Firefox track */
#volumeControl::-moz-range-track {
    height: 6px;
    background: #222;
    border: 1px solid #555;
    box-shadow: inset 0 0 4px #000;
}

/* Firefox thumb */
#volumeControl::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #c9c3a5;
    border: 2px solid #444;
    box-shadow: 0 0 5px #000;
    cursor: pointer;
}