/* Tarjetas de Silos Modulares */
.silo-aeration-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.silo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.silo-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 150px;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
    align-items: center;
}

.total-hours-display {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.total-hours-display div {
    font-size: 20px;
    font-weight: 900;
    color: var(--brand-green);
}

/* Interruptor Toggle (Estilo iOS/Moderno) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1; transition: .4s;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--brand-green); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* Hacer los selectores de hora nativos más grandes y cómodos */
input[type="time"] {
    font-family: 'Consolas', monospace;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    cursor: text;
}

/* ========================================== */
/* PANTALLA DE ALARMA Y DESLIZADOR            */
/* ========================================== */
#alarm-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(239, 68, 68, 0.95); /* Rojo crítico semi-transparente */
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    color: white; text-align: center;
    animation: bgPulse 2s infinite;
}

@keyframes bgPulse { 
    0% { background: rgba(239, 68, 68, 0.95); } 
    50% { background: rgba(185, 28, 28, 0.95); } /* Rojo más oscuro */
    100% { background: rgba(239, 68, 68, 0.95); } 
}

.alarm-icon { font-size: 90px; margin-bottom: 20px; text-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.alarm-content h1 { font-size: 32px; font-weight: 900; margin-bottom: 5px; }
.alarm-content h2 { font-size: 60px; font-weight: 900; color: #fef08a; margin: 10px 0; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* Diseño del Deslizador */
.swipe-container {
    width: 320px; height: 64px; 
    background: rgba(0, 0, 0, 0.4); 
    border-radius: 40px; 
    position: relative; 
    border: 2px solid rgba(255, 255, 255, 0.5);
    margin: 0 auto;
}

.swipe-text {
    position: absolute; width: 100%; line-height: 60px; 
    text-align: center; font-weight: 800; font-size: 16px;
    color: rgba(255, 255, 255, 0.7); user-select: none;
}

.swipe-thumb {
    position: absolute; top: 4px; left: 4px; 
    width: 52px; height: 52px; 
    background: white; border-radius: 50%; 
    color: #ef4444; display: flex; justify-content: center; align-items: center; 
    font-size: 24px; cursor: grab; z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background 0.2s;
}
.swipe-thumb:active { cursor: grabbing; background: #f8fafc; }

/* ========================================== */
/* EFECTOS DE VENTILACIÓN ACTIVA              */
/* ========================================== */
.silo-aeration-card.is-ventilating {
    border: 2px solid #38bdf8; /* Borde azul eléctrico */
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.15); /* Resplandor azul suave */
}

.fan-icon {
    font-size: 18px;
    margin-left: 5px;
}

/* Modificamos la velocidad del giro nativo de FontAwesome */
.fast-spin {
    animation: fa-spin 0.8s infinite linear; 
}

/* --- CONTROL DE COLAPSO --- */
.collapsible-section {
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 600px; /* Suficiente para el contenido */
    overflow: hidden;
    opacity: 1;
    flex-shrink: 0;
}

.collapsible-section.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-bottom: 0 !important;
}

.btn-collapse i.fa-chevron-down {
    transform: rotate(0deg);
}