/* ==============================
   SCADA SIMULATION - PIXEL MATCH
   ============================== */

.scada-container {
    width: 100%;
    height: 100%;
    background: #2a3040;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.scada-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    overflow-y: auto;
}


.scada-top-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.scada-group {
    display: flex;
    gap: 4px;
}

.sc-bin {
    width: 62px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #555;
}

.sc-header {
    padding: 3px 2px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}
.sc-header.green { background: #008080; }
.sc-header.gray { background: #808080; }
.sc-header.blue { background: #0088cc; }
.sc-header.red { background: #cc2222; }

.green-bin { border-color: #008080; }
.gray-bin { border-color: #808080; }
.blue-bin { border-color: #0088cc; }
.red-bin { border-color: #cc2222; }

.sc-row {
    border-bottom: 1px solid #999;
    padding: 1px 0;
    font-size: 11px;
}

.sc-vals {
    display: flex;
    flex-direction: column;
}
.sc-vals span {
    border-bottom: 1px solid #ccc;
    padding: 1px 0;
    font-size: 11px;
}
.sc-vals span:last-child { border-bottom: none; }

/* Gates (red triangles) */
.sc-gate {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #cc2222;
    margin: 4px auto;
    transition: border-top-color 0.3s;
}
.sc-gate.gate-open {
    border-top-color: #00cc66;
}

/* =========== MID AREA =========== */
.scada-mid-area {
    display: flex;
    gap: 15px;
    flex: 1;
}

/* LEFT: Belt controls + Gauge */
.scada-left-col {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.belt-controls {
    background: #333;
    border: 1px solid #555;
    padding: 6px 8px;
    border-radius: 3px;
}

.belt-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 12px;
}
.belt-row.sub { font-size: 11px; margin-bottom: 0; }

.arrow { color: #ccc; font-size: 10px; }

.ctrl-btn {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #888;
    cursor: pointer;
}
.on-btn, .on-btn-sm { background: #00cc66; color: #000; }
.off-btn, .off-btn-sm { background: #cc2222; color: #fff; }
.off-btn.active { background: #ff3333; box-shadow: 0 0 6px #ff3333; }

.speaker-icon { font-size: 14px; }

.belt-display {
    background: #111;
    color: #00cc66;
    padding: 2px 8px;
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #555;
}

/* Gauge */
.gauge-wrap {
    position: relative;
    width: 220px;
    height: 150px;
}
.gauge-svg { width: 100%; height: auto; }

.gauge-digital {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #00cc66;
    padding: 4px 12px;
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #00cc66;
}

/* CENTER COLUMN */
.scada-center-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Conveyor Belt */
.conveyor-belt {
    width: 90%;
    height: 14px;
    background: #888;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.conveyor-material {
    height: 100%;
    width: 0%;
    background: repeating-linear-gradient(
        90deg,
        #aaa 0px, #aaa 10px,
        #999 10px, #999 20px
    );
    transition: width 0.1s linear;
}

/* Skip area */
.skip-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skip-input-display {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #333;
    padding: 4px 8px;
    border: 1px solid #666;
    border-radius: 3px;
}
.skip-input-display input {
    width: 40px;
    background: #fff;
    color: #000;
    border: 1px solid #999;
    text-align: center;
    font-size: 12px;
    padding: 2px;
}
.skip-input-display span {
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
}

/* Weigh Hoppers */
.hoppers-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.w-hopper {
    width: 48px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.teal-hop { background: #008080; width: 60px; height: 95px; }
.gray-hop { background: #666; }
.blue-hop { background: #0088cc; }
.red-hop { background: #cc2222; }

.hop-val {
    background: #ffcc00;
    color: #000;
    padding: 3px 6px;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid #000;
    font-family: monospace;
}

.teal-hop .hop-val {
    background: #004040;
    color: #00cc66;
}

/* Mixer */
.mixer-area {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 5px;
}

.mixer-controls-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.mx-onoff {
    display: flex;
    flex-direction: column;
    border: 1px solid #888;
    border-radius: 3px;
    overflow: hidden;
}
.mx-on {
    background: #00cc66;
    color: #000;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}
.mx-off {
    background: #333;
    color: #fff;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.mx-icons {
    display: flex;
    gap: 4px;
    font-size: 18px;
}

.mixer-body {
    width: 250px;
    height: 110px;
    background: #ffcc00;
    clip-path: polygon(5% 0%, 95% 0%, 75% 100%, 25% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mixer-light {
    position: absolute;
    top: 20px;
    left: 40px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #222;
    border: 3px solid #00cc66;
    transition: all 0.3s;
}
.mixer-light.running {
    background: #00cc66;
    box-shadow: 0 0 12px #00cc66;
}

.mixer-num {
    background: #fff;
    color: #000;
    padding: 5px 14px;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #000;
    font-family: monospace;
}

.mixer-gate {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 12px;
    background: #fff;
    border: 1px solid #999;
    transition: background 0.3s;
}
.mixer-gate.gate-open {
    background: #00cc66;
}

.mixer-indicators {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 70px;
}
.mx-ind {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #555;
}
.red-ind { background: #cc2222; }
.yellow-ind { background: #ffcc00; }

/* Truck */
.truck-area {
    width: 200px;
    height: 80px;
    margin-top: 5px;
    transition: transform 2s ease, opacity 1.5s ease;
}
.truck-svg { width: 100%; height: auto; }

.truck-area.driving-out {
    transform: translateX(400px);
    opacity: 0;
}

/* =========== BOTTOM BAR =========== */
.scada-bottom-bar {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    background: #1e2530;
    border-top: 2px solid #444;
    align-items: center;
}

.sc-bottom-btn {
    background: #2a3441;
    color: #fff;
    border: 1px solid #888;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}
.sc-bottom-btn:hover { background: #3a4555; }

.btn-start {
    background: #00cc66;
    color: #000;
    font-size: 15px;
    font-weight: bold;
    padding: 10px 35px;
}
.btn-start:hover { background: #00aa55; }

.btn-speaker, .btn-mute {
    font-size: 18px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.sc-toggle {
    display: flex;
    flex-direction: column;
    border: 1px solid #888;
    overflow: hidden;
}
.sc-toggle button {
    background: #2a3441;
    color: #fff;
    border: none;
    border-bottom: 1px solid #666;
    padding: 4px 14px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.sc-toggle button:last-child { border-bottom: none; }
.sc-toggle button.active {
    background: #00cc66;
    color: #000;
    font-weight: bold;
}

.sc-bottom-right {
    margin-left: auto;
}
.sc-brand {
    font-weight: bold;
    font-size: 14px;
    color: #ccc;
    letter-spacing: 1px;
}
