/* /var/www/andes-mecatronic/css/riego-styles.css */
/* Estilos industrial-neon para Dashboard de Riego */

:root {
    --primary: #00b8a9;
    --primary-light: #00d4ff;
    --primary-neon: #00ffaa;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(10, 10, 15, 0.8);
    --text: #e0e0e0;
    --text-muted: #888;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
}

* {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: var(--text);
    min-height: 100vh;
    padding: 20px 0 40px 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tarjeta principal */
.main-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid rgba(0, 184, 169, 0.3);
    padding: 1.8rem;
    transition: all 0.3s ease;
}

.main-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 184, 169, 0.2);
}

/* ======= TÍTULOS INDUSTRIALES ======= */
h1, h2, h3, h4, h5, h6 {
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    letter-spacing: -0.3px;
}

h1 i, h2 i, h3 i, h4 i, h5 i, h6 i {
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-right: 8px;
}

/* Títulos dentro de tarjetas */
.device-card h4, .device-card h5, .device-card h6 {
    border-bottom: 1px solid rgba(0, 184, 169, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Textos */
.device-card p, .device-card div:not(.sensor-value):not(.temp-value) {
    color: var(--text);
}

small, .small, .text-muted {
    color: var(--text-muted) !important;
    font-size: 0.75rem;
}

label, .form-label {
    color: #ccc !important;
    font-weight: 500;
    margin-bottom: 5px;
}

.badge {
    background: var(--primary) !important;
    color: white !important;
    padding: 5px 12px;
    border-radius: 20px;
}

/* Tarjetas de dispositivos */
.device-card {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 1.2rem;
    border: 1px solid rgba(0, 184, 169, 0.2);
    transition: all 0.3s;
    height: 100%;
}

.device-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Tarjetas de vinculación */
.device-link-card {
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 20px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 184, 169, 0.1);
}

/* Inputs */
.device-code-input {
    background: rgba(20, 20, 30, 0.9);
    border: 2px solid var(--primary);
    color: var(--primary-neon);
    border-radius: 12px;
    padding: 12px 20px;
    width: 250px;
    font-family: monospace;
    font-weight: 600;
}

.device-code-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(0, 184, 169, 0.3);
}

/* Botones */
.btn-link-device {
    background: linear-gradient(90deg, var(--primary), #008b7d);
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-link-device:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 184, 169, 0.4);
}

/* Indicadores LED */
.led-indicator {
    width: 50px;
    height: 50px;
    margin: 10px auto;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.led-on {
    background: radial-gradient(circle, var(--primary-neon), var(--primary));
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.6);
}

.led-off {
    background: radial-gradient(circle, #2a2a2a, #1a1a1a);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 55px;
    height: 28px;
    cursor: pointer;
}

.switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2a2a2a;
    border-radius: 34px;
    transition: 0.3s;
    border: 1px solid var(--primary);
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background: var(--primary);
    border-radius: 50%;
    transition: 0.3s;
}

.switch.active .slider {
    background: linear-gradient(90deg, var(--primary), #008b7d);
}

.switch.active .slider:before {
    transform: translateX(27px);
    background: white;
}

/* Bomba animada */
.pump-icon {
    font-size: 3.5rem;
    transition: 0.1s linear;
    margin: 10px 0;
    display: inline-block;
}

.pump-spin {
    animation: pumpPulse 0.8s ease-in-out infinite;
}

@keyframes pumpPulse {
    0%, 100% { transform: scale(1); text-shadow: 0 0 5px var(--primary-neon); }
    50% { transform: scale(1.05); text-shadow: 0 0 15px var(--primary-neon); }
}

/* Válvulas */
.valve-icon {
    font-size: 2rem;
    transition: all 0.3s;
}

.valve-active {
    color: var(--primary-neon);
    text-shadow: 0 0 10px var(--primary-neon);
    animation: valveFlow 1s ease-in-out infinite;
}

@keyframes valveFlow {
    0%, 100% { opacity: 1; transform: translateX(0); }
    50% { opacity: 0.7; transform: translateX(3px); }
}

/* Zonas */
.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.zone-card {
    background: rgba(10, 10, 15, 0.8);
    border-radius: 20px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(0, 184, 169, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.zone-card:hover {
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 184, 169, 0.2);
}

.zone-card.active {
    border-color: var(--primary-neon);
    background: rgba(0, 255, 170, 0.1);
}

.zone-card strong {
    color: var(--primary-neon);
    font-size: 1rem;
    display: block;
    margin-bottom: 8px;
}

/* Barras de progreso */
.temp-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    height: 24px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid rgba(0, 184, 169, 0.3);
}

.temp-bar {
    width: 0%;
    height: 100%;
    transition: width 0.4s;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-neon));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-size: 11px;
}

.progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    height: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-light), var(--primary-neon));
    border-radius: 10px;
}

/* Valores de sensores */
.sensor-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-neon);
    margin: 10px 0;
}

.temp-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-neon);
}

/* Gráficos */
canvas {
    max-height: 180px;
    margin-top: 10px;
}

/* Badges de estado */
.status-badge {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-block;
}

.device-connected {
    background: rgba(0, 184, 169, 0.15);
    color: var(--primary-neon);
    border: 1px solid var(--primary-neon);
}

.device-disconnected {
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Selector de dispositivos */
.device-selector-card {
    background: rgba(10, 10, 15, 0.9);
    border-radius: 16px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.device-selector-card:hover {
    transform: translateY(-3px);
    background: rgba(20, 20, 30, 0.95);
}

.device-selector-card.active {
    border-color: var(--primary-neon);
    background: rgba(0, 255, 170, 0.1);
}

.device-name {
    font-weight: 600;
    color: var(--primary-neon);
}

.btn-switch-device {
    background: var(--primary);
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: white;
}

/* Logs */
.log-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.75rem;
    border: 1px solid rgba(0, 184, 169, 0.2);
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 184, 169, 0.1);
    color: #ccc;
}

.log-time {
    color: var(--primary-neon);
    margin-right: 10px;
}

/* Controles */
.controls-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.controls-enabled {
    opacity: 1;
    pointer-events: auto;
}

/* Sliders */
.form-range {
    background: rgba(0, 184, 169, 0.2);
    height: 4px;
    border-radius: 5px;
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-neon);
    cursor: pointer;
}

/* Alertas */
.alert-danger-custom {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--danger);
    color: #ff6b6b;
    border-radius: 12px;
    padding: 8px;
    font-size: 0.8rem;
}

.alert-warning-custom {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid var(--warning);
    color: var(--warning);
    border-radius: 12px;
    padding: 8px;
    font-size: 0.8rem;
}

.alert-success-custom {
    background: rgba(0, 184, 169, 0.15);
    border: 1px solid var(--primary-neon);
    color: var(--primary-neon);
    border-radius: 12px;
    padding: 8px;
    font-size: 0.8rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-card {
        padding: 1rem;
    }
    .sensor-value {
        font-size: 1.5rem;
    }
    .temp-value {
        font-size: 1.8rem;
    }
    .zones-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    .device-code-input {
        width: 100%;
        margin-bottom: 10px;
    }
}




/* ==================== CALENDARIO Y RELOJ ==================== */
.datetime-panel {
    background: rgba(10, 20, 15, 0.8);
    border-radius: 28px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #00b8a9;
}

.clock-digital {
    text-align: center;
    background: #0a0a0a;
    border-radius: 25px;
    padding: 1.2rem;
    border: 1px solid #00ffaa;
}

.clock-digital .time {
    font-size: 2.8rem;
    font-weight: bold;
    font-family: monospace;
    color: #00ffaa;
    letter-spacing: 3px;
}

.clock-digital .date {
    font-size: 1rem;
    color: #90EE90;
    margin-top: 8px;
}

.clock-digital .weekday {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 5px;
}

/* Contenedor del calendario */
.calendar-container {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 10px;
}

.calendar-header button {
    background: #00b8a9;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-header button:hover {
    background: #00ffaa;
    color: black;
    transform: scale(1.05);
}

.calendar-header h6 {
    margin: 0;
    color: #00ffaa;
    font-size: 1rem;
}

/* Días de la semana */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 15px;
    gap: 5px;
}

.calendar-weekdays div {
    color: #00ffaa;
    font-weight: bold;
    padding: 8px 5px;
    font-size: 0.8rem;
    background: rgba(0, 184, 169, 0.15);
    border-radius: 12px;
}

/* Días del mes - ¡CLAVE! */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    text-align: center;
    padding: 12px 5px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    font-weight: 500;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover {
    background: #00b8a9;
    transform: scale(1.05);
    color: white;
}

.calendar-day.selected {
    background: #00ffaa;
    color: black;
    font-weight: bold;
    box-shadow: 0 0 10px #00ffaa;
}

.calendar-day.today {
    border: 2px solid #00ffaa;
    background: rgba(0, 255, 170, 0.15);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
    box-shadow: none;
}

.calendar-day.empty:hover {
    background: transparent;
    transform: none;
}

/* Horarios Programados */
.horario-item {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
    border-left: 3px solid #00ffaa;
}

.horario-item:hover {
    background: rgba(0, 184, 169, 0.15);
}

.horario-item.horario-inactive {
    opacity: 0.6;
    border-left-color: #666;
}

.horario-time {
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    color: #00ffaa;
}

.zone-badge {
    background: #00b8a9;
    color: white;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    margin: 0 2px;
    display: inline-block;
}

.btn-add-horario {
    background: linear-gradient(90deg, #00b8a9, #008b7d);
    border: none;
    padding: 10px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s;
}

.btn-add-horario:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 169, 0.3);
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .clock-digital .time {
        font-size: 2rem;
    }
    .calendar-weekdays div {
        font-size: 0.65rem;
        padding: 5px 2px;
    }
    .calendar-day {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
    .horario-time {
        font-size: 0.8rem;
    }
}








/* Estilo para zonas activas con fondo luminoso */
.zone-card.active {
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.15), rgba(0, 184, 169, 0.1));
    border: 2px solid #00ffaa;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
    transition: all 0.3s ease;
}

.zone-card.active .valve-icon {
    color: #00ffaa;
    text-shadow: 0 0 10px #00ffaa;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}