/* --- style.css --- */

/* --- RESET & VARIABLES --- */
* {
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --sensor-active: #ffdd00;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 15px;
    color: var(--text-color);
    min-height: 100vh;
}

/* --- HEADER --- */
/*.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.header h1 { font-size: 1.4rem; color: #111827; margin: 0; }
@media (max-width: 480px) { 
    .header { flex-direction: column; align-items: flex-start; } 
    .header h1 { font-size: 1.2rem; } 
}*/
/* --- HEADER (DISEÑO ACTUALIZADO) --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Esto selecciona el contenedor del Título y Subtítulo */
.header>div:first-child {
    border: 2px solid var(--primary-color);
    /* Borde Azul */
    background-color: rgba(37, 99, 235, 0.05);
    /* Fondo azul muy sutil */
    padding: 10px 20px;
    border-radius: 8px;
    /* Bordes redondeados */
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.673);
}

.header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    /* Texto Azul (#2563eb) */
    margin: 0;
    font-weight: 800;
    /* Letra más gruesa */
    text-transform: uppercase;
    /* Opcional: Mayúsculas para estilo industrial */
    letter-spacing: 0.5px;
}

/* Estilo para el subtítulo (dentro del small) */
.header small {
    color: var(--primary-color) !important;
    /* Texto Azul */
    font-weight: 600;
    font-size: 0.85rem;
    display: block;
    /* Asegura que quede debajo del título */
    margin-top: 4px;
    opacity: 0.9;
}

/* Ajuste Responsive */
@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header>div:first-child {
        text-align: center;
    }

    .header h1 {
        font-size: 1.2rem;
    }
}

/* --- CONTROLES --- */
.control-panel {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.timer-display {
    margin-left: auto;
    font-family: monospace;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-sim {
    background-color: var(--primary-color);
    color: white;
}

.btn-sim:hover {
    opacity: 0.9;
}

.btn-sim.active {
    background-color: var(--danger-color);
}

@media (max-width: 600px) {
    .timer-display {
        width: 100%;
        text-align: center;
        margin-top: 5px;
        order: 2;
    }

    .btn-sim {
        width: 100%;
        justify-content: center;
        order: 1;
    }
}

/* --- GRID KPIS --- */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
}

.card-title {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.pressure-gauge {
    color: var(--primary-color);
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-on {
    background-color: var(--success-color);
    box-shadow: 0 0 6px var(--success-color);
}

.status-off {
    background-color: #d1d5db;
}

/* --- LAYOUT SECCIÓN INFERIOR --- */
.lower-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

@media (min-width: 900px) {
    .lower-section {
        flex-direction: row;
        align-items: flex-start;
    }

    .gemelo-card {
        flex: 2;
        min-width: 0;
    }

    .right-column-group {
        flex: 1;
        min-width: 0;
    }
}

.right-column-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* --- GEMELO DIGITAL --- */
.graphic-wrapper {
    width: 100%;
    position: relative;
    height: 0;
    padding-bottom: 37.5%;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.graphic-wrapper svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- CHART & STATUS --- */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.component-status {
    display: flex;
    align-items: center;
    margin-top: 12px;
    font-size: 0.9rem;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.component-status:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* --- ANIMACIONES --- */
.conveyor-belt-moving {
    animation: moveBelt 1s linear infinite;
}

@keyframes moveBelt {
    from {
        stroke-dashoffset: 20;
    }

    to {
        stroke-dashoffset: 0;
    }
}

.sensor-body {
    fill: #9ca3af;
    transition: fill 0.2s;
}

.sensor-active {
    fill: var(--sensor-active);
    filter: drop-shadow(0 0 5px var(--sensor-active));
}

.piston-rod {
    fill: #d1d5db;
    transition: transform 0.3s ease-out;
}

.piston-extend-p1 {
    transform: translateY(40px);
}

.piston-extend-p2 {
    transform: translateY(40px);
}

#sim-box {
    opacity: 0;
    pointer-events: none;
}

.box-moving {
    animation: moveBoxPath 4s linear forwards;
}

@keyframes moveBoxPath {
    0% {
        transform: translateX(0px);
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    95% {
        opacity: 0;
    }

    100% {
        transform: translateX(750px);
        opacity: 0;
    }
}

/* --- FOOTER --- */
.main-footer {
    margin-top: 40px; /* Separación del contenido principal */
    padding: 30px 0;
    background-color: white;
    border-top: 1px solid #e5e7eb; /* Línea sutil arriba */
    text-align: center;
    border-radius: 12px 12px 0 0; /* Redondeado solo arriba */
    box-shadow: 0 -4px 6px rgba(0,0,0,0.02); /* Sombra suave hacia arriba */
}

.footer-content p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 15px;
    margin-top: 0;
}

/* Contenedor de iconos */
.social-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Botones de redes sociales */
.social-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #f3f4f6;
    color: var(--text-color);
    border-radius: 50%; /* Círculo perfecto */
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    border: 1px solid transparent;
}

/* Efecto Hover (Al pasar el mouse) */
.social-btn:hover {
    background-color: var(--primary-color); /* Se pone azul */
    color: white;
    transform: translateY(-3px); /* Se eleva un poco */
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3); /* Sombra azul brillante */
    border-color: var(--primary-color);
}