/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    background: #2c313a;
    color: #e0e0e0;
}

/* LAYOUT BASE (PC) */
.scada-container {
    display: grid;
    grid-template-rows: 70px 1fr 100px;
    height: 100vh;
}

/* TOP BAR */
.top-bar {
    background: #1f2328;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    border-bottom: 2px solid #0078d4;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

/* LEDS */
.led-panel {
    display: flex;
    gap: 25px;
}

.led-box {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.led {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #111;
}

.led-green.active {
    background: #00ff55;
    box-shadow: 0 0 10px #00ff55;
    animation: pulse 1.5s infinite;
}

.led-red.active {
    background: #ff2a2a;
    box-shadow: 0 0 10px #ff2a2a;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px #00ff55; }
    50% { box-shadow: 0 0 20px #00ff55; }
    100% { box-shadow: 0 0 5px #00ff55; }
}

/* VIDEO */
.video-container {
    position: relative;
    background: black;
    overflow: hidden;
}

.video-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain; /* muestra máquina completa */
    background: black;
    transition: opacity 0.15s linear;
}

.video-layer.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-layer:not(.hidden) {
    opacity: 1;
}

/* Overlay */
.overlay {
    position: absolute;
    top: 15px;
    left: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status {
    background: rgba(0,0,0,0.75);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #555;
    font-size: 13px;
}

.status.marcha {
    color: #00ff55;
    border-color: #00ff55;
}

.status.paro {
    color: #ff2a2a;
    border-color: #ff2a2a;
}

/* CONTROL PANEL */
.control-panel {
    background: #1f2328;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 25px;
    border-top: 2px solid #0078d4;
}

.modes, .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button {
    background: #3b4046;
    border: 1px solid #555;
    padding: 8px 18px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
}

button:hover {
    background: #50565e;
}

.btn.marcha { background: #006400; }
.btn.paro { background: #8b0000; }
.btn.giro { background: #003c8f; }

/* ============================= */
/* 📱 MODO MÓVIL AUTOMÁTICO */
/* ============================= */
@media (max-width: 768px) {

    .scada-container {
        grid-template-rows: 60px 1fr auto;
    }

    .top-bar {
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding: 8px;
        text-align: center;
    }

    .title {
        font-size: 15px;
    }

    .control-panel {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .modes, .actions {
        justify-content: center;
        width: 100%;
    }

    button {
        flex: 1;
        min-width: 80px;
    }

    .overlay {
        top: 10px;
        left: 10px;
        font-size: 12px;
    }
}/* Logo centrado sin alterar diseño original */
.top-bar {
    position: relative;
}

.logo-central {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #00c8ff;
    pointer-events: none;
}

/* ocultar info extra por defecto */
.hidden {
    display: none;
}