/* =========================================
   HMI 1: Red PLC SCADA (Slider 1)
========================================= */
.hmi-network {
    position: relative;
    width: 450px;
    height: 450px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* El cerebro central */
.hmi-core {
    position: absolute;
    width: 130px;
    height: 130px;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #00d4ff;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.hmi-core i {
    font-size: 45px;
    color: #00d4ff;
    margin-bottom: 8px;
}

.hmi-core span {
    color: #fff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 15px;
}

/* Pulso de red */
.hmi-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #00d4ff;
    border-radius: 15px;
    animation: scadaPulse 2s infinite ease-out;
}

/* Nodos (Sensores/Motores) */
.hmi-node {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #1e293b;
    border: 2px solid #94a3b8;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: #fff;
    font-size: 22px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.hmi-node.n1 {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border-color: #f59e0b;
    color: #f59e0b;
}

.hmi-node.n2 {
    bottom: 60px;
    left: 15px;
    border-color: #22c55e;
    color: #22c55e;
}

.hmi-node.n3 {
    bottom: 60px;
    right: 15px;
    border-color: #00d4ff;
    color: #00d4ff;
}

/* Líneas de datos SVG */
.hmi-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hmi-line {
    stroke: #00d4ff;
    stroke-width: 3;
    stroke-dasharray: 10, 15;
    animation: dashMove 10s linear infinite;
    opacity: 0.6;
}

@keyframes scadaPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes dashMove {
    to {
        stroke-dashoffset: -500;
    }
}

/* =========================================
   HMI 2: Dashboard Telemetría IoT (Slider 2)
========================================= */
.hmi-dashboard {
    position: relative;
    width: 450px;
    height: auto;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid #334155;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    padding: 30px;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    backdrop-filter: blur(8px);
    margin: 0 auto;
}

/* Encabezado del panel */
.hmi-dash-header {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-weight: bold;
    font-size: 15px;
}

.hmi-blink {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 12px #22c55e;
    animation: blinker 1s infinite;
    vertical-align: middle;
}

/* Tarjetas de métricas */
.hmi-data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.hmi-data-card {
    background: #1e293b;
    border: 1px inset #475569;
    padding: 20px;
    border-radius: 8px;
    width: 47%;
    text-align: center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.hmi-data-card span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 8px;
}

.hmi-data-card strong {
    font-size: 32px;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

/* Gráfico de ondas animado */
.hmi-chart-container {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.hmi-chart {
    width: 100%;
    height: 100px;
    background: repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(51, 65, 85, 0.5) 20px), repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(51, 65, 85, 0.5) 20px);
    position: relative;
}

.hmi-svg-chart {
    width: 100%;
    height: 100%;
}

.hmi-wave {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 3;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawWave 4s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 5px #f59e0b);
}

/* Animaciones */
@keyframes blinker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

@keyframes drawWave {
    0% {
        stroke-dashoffset: 800;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* Ajuste sutil flotante para ambos paneles */
.hmi-network,
.hmi-dashboard {
    animation: floatHMI 6s ease-in-out infinite;
}

@keyframes floatHMI {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Widget */
/* =========================================
   Widget Flotante SCADA (Temperatura) - 2 Líneas
========================================= */
.slider-one .slider-one_percentage {
    right: -30px !important;
    /* Lo separamos un poco más del HMI */
    top: -20px !important;
    z-index: 20 !important;
    width: auto !important;
    min-width: 120px;
    padding: 15px 25px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Forzamos un fondo oscuro y limpio para que contraste */
    background-color: rgba(15, 23, 42, 0.95) !important;
    background-image: none !important;
    /* Quitamos la imagen de fondo por defecto */
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}

/* El número (45°C) en Blanco Brillante */
.slider-one .slider-one_percentage .slider-one_percent,
.slider-one .slider-one_percentage .slider-one_percent sub {
    -webkit-text-fill-color: #ffffff !important;
    /* Anula el gradiente original */
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3) !important;
    margin-bottom: 2px !important;
}

/* La segunda línea (Icono + Texto) */
.slider-one .slider-one_percentage .slider-one_percentage-text {
    -webkit-text-fill-color: #94a3b8 !important;
    /* Gris claro/plateado */
    color: #94a3b8 !important;
    font-size: 15px !important;
    display: flex !important;
    align-items: center;
    gap: 6px;
    /* Espacio entre el ícono y la palabra "Temp." */
}

/* El ícono de temperatura en Cyan */
.slider-one .slider-one_percentage .slider-one_percentage-text i {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    font-size: 16px !important;
    color: #00d4ff !important;
    /* Cyan SCADA */
    margin: 0 !important;
}

/* =========================================
   Widget de Proceso (Motor/Compresor animado)
========================================= */
.slider-one .slider-one_graph.hmi-mini-process {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 15px 20px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    bottom: -50px !important;
    /* Ajusta esto para subirlo o bajarlo */
    left: -40px !important;
    /* Ajusta esto para moverlo a los lados */
    width: auto !important;
    min-width: 200px;
    z-index: 20;
}

/* Título del widget */
.hmi-process-title {
    color: #94a3b8;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 2px;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
}

/* Contenedor del motor y el tubo */
.hmi-process-animation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 15px 0;
}

/* El círculo exterior de la turbina */
.hmi-fan-container {
    width: 45px;
    height: 45px;
    border: 2px solid #00d4ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    background: #0f172a;
}

/* Animación de rotación rápida */
.hmi-fan-spin {
    font-size: 22px;
    animation: fanSpin 0.3s linear infinite;
    /* Muy rápido para simular alta presión */
}

@keyframes fanSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* La tubería */
.hmi-pipe-status {
    flex-grow: 1;
    height: 8px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Los "paquetes" de presión/fluido moviéndose */
.hmi-flow-dot {
    position: absolute;
    top: 0;
    left: -15px;
    width: 20px;
    height: 100%;
    background: #22c55e;
    /* Color verde de estado normal */
    box-shadow: 0 0 10px #22c55e;
    animation: flowMove 1s linear infinite;
}

.hmi-flow-dot.delay-1 {
    animation-delay: 0.3s;
}

.hmi-flow-dot.delay-2 {
    animation-delay: 0.6s;
}

@keyframes flowMove {
    0% {
        left: -20px;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Texto de Estado inferior */
.hmi-process-status {
    color: #22c55e;
    font-size: 12px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

/* Puntito LED parpadeando */
.hmi-process-status .blink-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: blinker 1s infinite;
}

/* =========================================
   Widget de Enlace/Red SCADA (Slider 1)
========================================= */
.slider-one .slider-one_graph.hmi-mini-network {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 15px 20px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    bottom: 30px !important;
    left: -40px !important;
    width: auto !important;
    min-width: 200px;
    z-index: 20;
}

/* Estadísticas de red */
.hmi-network-stats {
    margin: 15px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #94a3b8;
}

.hmi-network-stats .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px dashed #334155;
    padding-bottom: 4px;
}

/* Barras de señal estilo telemetría */
.hmi-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 25px;
    margin-top: 10px;
}

.hmi-signal-bars .bar {
    width: 10px;
    background: #334155;
    border-radius: 2px;
}

/* Altura escalonada de las barras */
.hmi-signal-bars .bar-1 {
    height: 40%;
}

.hmi-signal-bars .bar-2 {
    height: 60%;
}

.hmi-signal-bars .bar-3 {
    height: 80%;
}

.hmi-signal-bars .bar-4 {
    height: 100%;
}

/* Color de señal activa */
.hmi-signal-bars .bar.active {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

/* Animación de la última barra simulando transmisión de datos */
.hmi-signal-bars .blink-bar {
    animation: signalBlink 0.5s infinite alternate;
}

@keyframes signalBlink {
    0% {
        opacity: 0.3;
        box-shadow: none;
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    }
}

/* =========================================
   ANIMACIÓN: BANDA TRANSPORTADORA (SOLUXPRO)
========================================= */

/* Ajuste del widget flotante de velocidad */
.slider-one .hmi-conveyor-stats {
    right: -30px !important;
    top: -20px !important;
    z-index: 20 !important;
}

/* Contenedor principal de la animación */
.conveyor-animation-container {
    position: relative;
    height: 120px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-top: 15px;
    overflow: hidden;
    padding-top: 20px;
}

/* Sensor / Lector Láser Superior */
.sensor-laser {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 0 0 4px 4px;
    z-index: 10;
}

/* El rayo láser rojo bajando */
.laser-beam {
    position: absolute;
    top: 15px;
    left: 14px;
    width: 2px;
    height: 105px;
    background: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 10px #ef4444;
}

/* Pista por donde se mueven las cajas */
.boxes-track {
    position: absolute;
    bottom: 25px;
    /* Altura de la banda */
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 5;
}

/* Diseño de las Cajas */
.boxes-track .box {
    position: absolute;
    bottom: 0;
    width: 35px;
    height: 35px;
    background: #d97706;
    /* Color de cartón */
    border: 2px solid #b45309;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    /* La animación mueve la caja de izquierda a derecha */
    animation: moveBox 4.5s linear infinite;
    opacity: 0;
}

/* Retrasos para que no salgan todas al mismo tiempo */
.boxes-track .box-1 {
    animation-delay: 0s;
}

.boxes-track .box-2 {
    animation-delay: 1.5s;
    background: #ea580c;
    border-color: #c2410c;
}

/* Una caja distinta */
.boxes-track .box-3 {
    animation-delay: 3s;
}

@keyframes moveBox {
    0% {
        left: -50px;
        opacity: 1;
    }

    100% {
        left: 110%;
        opacity: 1;
    }
}

/* Estructura Física de la Banda Transportadora */
.conveyor-belt {
    position: absolute;
    bottom: 5px;
    left: -10px;
    width: calc(100% + 20px);
    height: 20px;
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    overflow: hidden;
}

/* Superficie de la banda rodando (Líneas moviéndose) */
.belt-surface {
    position: absolute;
    top: -2px;
    left: 0;
    width: 200%;
    height: 4px;
    /* Patrón de rayas para simular textura de goma */
    background: repeating-linear-gradient(90deg, #0f172a, #0f172a 10px, #334155 10px, #334155 20px);
    animation: rollBelt 1s linear infinite;
    z-index: 2;
}

@keyframes rollBelt {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-40px);
    }
}

/* Rodillos internos girando */
.rollers {
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    z-index: 1;
}

.roller {
    width: 10px;
    height: 10px;
    background: #94a3b8;
    border-radius: 50%;
    border: 2px dashed #475569;
    animation: spinRoller 1s linear infinite;
}

@keyframes spinRoller {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   Widget: Estado del PLC (Cerebro de la Banda)
========================================= */
.slider-one .slider-one_graph.hmi-mini-plc {
    background-color: #2d3748 !important;
    /* Gris industrial oscuro */
    border: 2px solid #94a3b8 !important;
    border-radius: 4px !important;
    /* Bordes más rectos como un equipo real */
    padding: 15px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    bottom: -50px !important;
    left: -40px !important;
    width: auto !important;
    min-width: 240px;
}

/* Panel de LEDs de Diagnóstico */
.plc-status-leds {
    display: flex;
    justify-content: space-around;
    background: #1a202c;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px inset #4a5568;
}

.plc-led {
    color: #cbd5e1;
    font-size: 9px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: Arial, sans-serif;
}

.plc-led span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334155;
    border: 1px solid #1a202c;
}

/* Colores de los LEDs */
.plc-led .led-green.active {
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.plc-led .led-orange.active {
    background: #eab308;
    box-shadow: 0 0 8px #eab308;
}

.plc-led .led-red.active {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

/* Grid de Entradas/Salidas */
.plc-io-grid {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.io-column {
    flex: 1;
}

.io-label {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 8px;
    border-bottom: 1px solid #4a5568;
}

.io-point {
    color: #fff;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

/* LEDs pequeños de los bornes del PLC */
.led-point {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: #334155;
}

.led-point.active {
    background: #f59e0b;
    /* Color naranja/ámbar clásico de los PLC */
    box-shadow: 0 0 5px #f59e0b;
    animation: plcBlink 2s infinite alternate;
    /* Simula que el sensor detecta algo */
}

@keyframes plcBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Unificar la altura de los Dashboards para evitar saltos verticales en los widgets */
.slider-one .hmi-dashboard {
    height: 380px !important;
    /* Fuerza la misma altura para ambos paneles */
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    /* Distribuye el espacio interno uniformemente */
}

/* =========================================
   Ajustes para el Compresor Dual (Igualando al PLC)
========================================= */
.slider-one .slider-one_graph.hmi-mini-process {
    background-color: #2d3748 !important; /* Igualamos el gris oscuro del PLC */
    min-width: 240px !important; /* Forzamos el mismo ancho que el PLC */
    border-radius: 4px !important; /* Bordes rectos industriales */
}

.hmi-dual-animation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.hmi-process-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}