/* PALETA DE COLORES AZUL (CYBER BLUE THEME) */
:root {
    --bg-dark: #020b1c; /* Azul muy oscuro casi negro */
    --glass-bg: rgba(2, 20, 40, 0.4);
    --glass-border: rgba(0, 210, 255, 0.15);
    --neon-blue: #00d2ff; /* Color principal */
    --neon-accent: #0077ff;
    --danger-red: #ff3366;
    --text-main: #e6f1ff;
    --text-muted: #6486a8;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
body {
    margin: 0; font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    /* Fondo radial azulado */
    background-image: radial-gradient(circle at 50% 0%, #0a2e52 0%, #020b1c 80%);
    color: var(--text-main); min-height: 100vh; overflow-x: hidden;
}

/* Animación de fondo (Manchas azules) */
.background-blobs {
    position: fixed; top: -10%; left: -20%; width: 80vw; height: 80vw;
    background: var(--neon-blue); filter: blur(140px); opacity: 0.08;
    border-radius: 50%; z-index: -1; pointer-events: none;
    animation: moveBlob 20s infinite alternate ease-in-out;
}
@keyframes moveBlob { from { transform: translate(0,0); } to { transform: translate(30px, 50px) scale(1.1); } }

.app-container { max-width: 480px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }

/* ESTILO GLASS GENERAL */
.glass-card {
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: 20px; padding: 20px; box-shadow: var(--card-shadow);
}

/* HEADER */
.header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; }
.title-group { display: flex; align-items: center; gap: 12px; }
.logo-icon { color: var(--neon-blue); font-size: 1.4rem; filter: drop-shadow(0 0 5px var(--neon-blue)); }
h1 { margin: 0; font-size: 1.2rem; font-weight: 600; letter-spacing: 0.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: block; }
.dot.offline { background: #444; box-shadow: 0 0 5px #444; }
.dot.online { background: var(--neon-blue); box-shadow: 0 0 10px var(--neon-blue); }
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted); }

/* DASHBOARD CLIMÁTICO (GRID 2x3) */
.weather-dashboard { padding: 15px; }
.location-badge { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-bottom: 15px; }
.weather-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; row-gap: 20px; }
.weather-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.icon-blue { font-size: 1.2rem; color: var(--neon-blue); margin-bottom: 5px; opacity: 0.9; }
.w-value { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.w-label { font-size: 0.7rem; color: var(--text-muted); }

/* GRÁFICA */
.chart-card h3 { margin: 0 0 10px 0; font-size: 0.85rem; color: var(--text-muted); text-align: center; text-transform: uppercase; }
.chart-container { position: relative; height: 160px; width: 100%; }

/* SENSORES (GAUGES) */
.sensors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.sensor-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 15px; }
.sensor-card h3 { margin: 0 0 10px 0; font-size: 0.85rem; color: var(--text-muted); }
.gauge-container { position: relative; width: 85px; height: 85px; }
.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 250px; }
.circle-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 2.5; }
.circle { fill: none; stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray 1s ease-out; }
.circular-chart.blue .circle { stroke: var(--neon-blue); } /* Azul */
.percentage { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.1rem; font-weight: bold; color: #fff; }

/* CONTROLES (1 FILA) */
.control-section { width: 100%; }
.control-row { display: flex; gap: 10px; align-items: stretch; }

.glass-btn {
    border: 1px solid var(--glass-border); border-radius: 16px;
    background: rgba(0, 210, 255, 0.05); color: var(--text-main);
    cursor: pointer; transition: all 0.3s; backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.glass-btn:active { transform: scale(0.96); background: rgba(0, 210, 255, 0.1); }

/* Micrófono */
.icon-btn { width: 60px; height: 65px; font-size: 1.3rem; flex-shrink: 0; padding: 0; }
.listening { background: var(--neon-blue); color: #000; animation: pulseMic 1.5s infinite; }
@keyframes pulseMic { 0% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* Botones Acción */
.action-btn { flex: 1; height: 65px; font-size: 0.9rem; font-weight: 600; flex-direction: column; gap: 5px; line-height: 1; }

/* Estados Activos (Riego y Luces) */
.action-btn.active {
    background: rgba(0, 210, 255, 0.2); border-color: var(--neon-blue);
    color: #fff; box-shadow: 0 0 20px rgba(0, 210, 255, 0.3); text-shadow: 0 0 8px var(--neon-blue);
}
.action-btn.lights-on {
    background: rgba(255, 255, 255, 0.15); border-color: #fff;
    color: #fff; box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 5, 15, 0.9); backdrop-filter: blur(5px);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}
.modal-content { width: 85%; max-width: 320px; text-align: center; border: 1px solid var(--neon-blue); }
.modal-icon { font-size: 3rem; color: var(--neon-blue); margin-bottom: 15px; }
.confirm { border-color: var(--neon-blue); color: var(--neon-blue); }
.cancel { border-color: var(--danger-red); color: var(--danger-red); }

.footer { text-align: center; font-size: 0.7rem; color: var(--text-muted); padding: 15px; margin-top: 10px; }
