/* =========================================
   BASE (Anteriormente base.css)
   ========================================= */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    padding: 20px; 
    background-color: #f4f7f6; 
    transition: background-color 0.3s ease; 
}

h1 { 
    text-align: center; 
    color: #2c3e50; 
    margin-bottom: 30px; 
}
.title-logo {
    height: 4em; /* Hace que el logo tenga exactamente el mismo alto que la letra del h1 */
    vertical-align: middle; /* Lo centra con el texto */
    margin-right: 1px; /* Le da un pequeño respiro antes del texto */
}

/* =========================================
   LAYOUT (Anteriormente layout.css)
   ========================================= */
.header-container { text-align: center; margin-bottom: 30px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.charts-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; max-width: 1000px; margin: 20px auto; }

@media (max-width: 600px) { 
    body { padding: 15px; } 
    .grid { grid-template-columns: 1fr; } 
    .value { font-size: 24px; } 
}

/* =========================================
   COMPONENTES (Anteriormente components.css)
   ========================================= */
.card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; align-items: center; transition: transform 0.2s ease; }
.card:hover { transform: translateY(-3px); }

.icon { font-size: 35px; margin-right: 20px; min-width: 50px; text-align: center; }
.content { display: flex; flex-direction: column; }
.label { font-size: 13px; color: #7f8c8d; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.value { font-size: 28px; color: #2c3e50; font-weight: 600; margin-top: 5px; }
.unit { font-size: 16px; color: #95a5a6; margin-left: 5px; font-weight: 400; }

/* Botones de Vista */
.view-toggle { background: #e0e6ed; display: inline-flex; border-radius: 30px; padding: 5px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); }
.view-toggle button { background: transparent; border: none; padding: 10px 25px; border-radius: 25px; cursor: pointer; font-size: 14px; font-weight: 600; color: #7f8c8d; transition: all 0.3s ease; }
.view-toggle button.active { background: #2c3e50; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* Panel de Control Vertical */
.control-panel { background: white; max-width: 400px; margin: 30px auto; padding: 20px 25px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.vertical-panel { display: flex; flex-direction: column; }
.control-row { display: flex; align-items: center; width: 100%; }

/* Switches */
.switch { position: relative; display: inline-block; width: 60px; height: 32px; flex-shrink: 0;}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d1d8e0; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: #3498db; }
input:checked + .slider:before { transform: translateX(28px); }
.eco-switch input:checked + .slider { background-color: #2ecc71; }
input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* Tarjetas de Gráficas */
.chart-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; }
.chart-card h3 { color: #2c3e50; font-size: 14px; margin-bottom: 20px; text-transform: uppercase; }

/* =========================================
   UTILIDADES (Anteriormente utilities.css)
   ========================================= */
body.basic-mode .advanced-only { display: none !important; }

.status-on { 
    color: #2ecc71; 
    font-weight: bold; 
    text-align: center; 
    margin-bottom: 20px; 
    background: #e8f8f5; 
    padding: 10px; 
    border-radius: 8px; 
    max-width: 400px; 
    margin: 0 auto 20px auto; 
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.1); 
}

/* =========================================
   MODO OSCURO
   ========================================= */
body.dark-mode {
    background-color: #121212;
}
body.dark-mode h1 {
    color: #ffffff;
}
body.dark-mode .card,
body.dark-mode .chart-card,
body.dark-mode .control-panel {
    background: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
body.dark-mode .value,
body.dark-mode .chart-card h3 {
    color: #ffffff;
}
body.dark-mode .label {
    color: #aaaaaa;
}
body.dark-mode .unit {
    color: #777777;
}
body.dark-mode .view-toggle {
    background: #2c2c2c;
}
body.dark-mode .view-toggle button {
    color: #bbbbbb;
}
body.dark-mode .view-toggle button.active {
    background: #00cbb4;
    color: #ffffff;
}
body.dark-mode .control-panel h3 {
    color: #ffffff !important;
    border-bottom: 1px solid #333333 !important;
}
body.dark-mode .status-on {
    background: #143324;
    color: #2ecc71;
    box-shadow: none;
}