/* ==========================================================================
   CSS GLOBAL Y MODERNIZACIÃ“N REDAIRE IPN
   ========================================================================== */

/* 1. VARIABLES (SISTEMA DE DISEÃ‘O) */
:root {
    /* Paleta de Colores Original IPN (Restaurada y Modernizada) */
    --color-ipn-guinda: #6c1d45;
    --color-ipn-guinda-light: #8d285c;
    --color-ipn-guinda-dark: #4d1431;
    
    /* Neutros */
    --color-white: #ffffff;
    --color-bg-light: #f4f7f6;
    --color-text-main: #2d3748;
    --color-text-muted: #718096;
    --color-border: #e2e8f0;
    
    /* Sombras Glassmorphism y Elevaciones */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.05), 0 6px 6px rgba(0,0,0,0.02);
    --shadow-lg: 0 15px 25px rgba(108, 29, 69, 0.15);
    
    /* TipografÃ­a */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. RESET Y BASES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-main);
    background-color: var(--color-bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-ipn-guinda-dark);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 3. COMPONENTES GLOBALES (Botones) */
.btn-primary, .btn-secondary, .btn-white {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-ipn-guinda), var(--color-ipn-guinda-light));
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: var(--color-white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-ipn-guinda);
}

.btn-white {
    background-color: var(--color-white);
    color: var(--color-ipn-guinda);
    box-shadow: var(--shadow-md);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* 4. NAVBAR (Estilo Glassmorphism) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0.5rem 0;
    transition: all var(--transition-fast);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logos img {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.navbar-logos img:hover {
    transform: scale(1.05);
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.navbar-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-main);
}

.navbar-links a:hover, .navbar-links a.active {
    color: var(--color-ipn-guinda);
}

.navbar-links .btn-primary {
    color: var(--color-white);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--color-ipn-guinda);
    cursor: pointer;
}

/* 5. HERO SECTION */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-ipn-guinda-dark), var(--color-ipn-guinda));
    overflow: hidden;
    padding-top: 80px; /* Offset navbar */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    opacity: 0.6;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    animation: fadeUp 1s ease-out forwards;
}

.hero-content .badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--color-white);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Animaciones */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Formas Abstractas Flotantes */
.hero-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.01));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    z-index: 1;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    right: 50px;
    animation-delay: 2s;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(40px) rotate(15deg); }
}

/* 6. SECCIÃ“N DE INFORMACIÃ“N */
.info-section {
    padding: 6rem 0;
    background-color: var(--color-bg-light);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.info-text h2 {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.info-text h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 80px;
    height: 4px;
    background-color: var(--color-ipn-guinda);
    border-radius: 2px;
}

.info-text p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.info-cards {
    display: grid;
    gap: 1.5rem;
}

.card {
    background: var(--color-white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-smooth);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-ipn-guinda-light);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--color-ipn-guinda);
    margin-bottom: 0.5rem;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

/* 7. BANNER CTA */
.banner-section {
    background: linear-gradient(135deg, var(--color-ipn-guinda), var(--color-ipn-guinda-dark));
    padding: 5rem 0;
    text-align: center;
    color: var(--color-white);
}

.banner-content h2 {
    color: var(--color-white);
    font-size: 2.5rem;
}

.banner-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
}

/* 8. FOOTER */
.footer {
    background-color: #1a202c;
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logos img {
    height: 50px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.95rem;
}

.footer-links h4, .footer-social h4 {
    color: var(--color-white);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links a, .footer-social a {
    display: block;
    margin-bottom: 0.8rem;
}

.footer-links a:hover, .footer-social a:hover {
    color: var(--color-white);
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--color-white);
}

.social-icons a:hover {
    background: var(--color-ipn-guinda);
}

.footer-bottom {
    background-color: #111827;
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.85rem;
}

/* 9. RESPONSIVIDAD (Media Queries) */
@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .navbar-links {
        display: none; /* Idealmente se cambia a menÃº mÃ³vil con JS */
    }
    
    .menu-toggle {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logos {
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
}

/* ==========================================================================
   DASHBOARD STYLES
   ========================================================================== */

.dashboard-body {
    background-color: var(--color-bg-light);
    padding-top: 70px;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Controles */
.dashboard-sidebar {
    width: 280px;
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.control-group label i {
    color: var(--color-ipn-guinda);
    font-size: 1.2rem;
}

.station-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-station {
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-align: left;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-muted);
}

.btn-station:hover {
    border-color: var(--color-ipn-guinda-light);
    color: var(--color-ipn-guinda-light);
}

.btn-station.active {
    background: var(--color-ipn-guinda);
    color: var(--color-white);
    border-color: var(--color-ipn-guinda);
    box-shadow: var(--shadow-sm);
}

.range-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-range {
    padding: 0.5rem;
    background: var(--color-bg-light);
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-muted);
}

.btn-range:hover {
    background: #e2e8f0;
}

.btn-range.active {
    background: var(--color-white);
    border-color: var(--color-ipn-guinda);
    color: var(--color-ipn-guinda);
    box-shadow: var(--shadow-sm);
}

/* Indicador de estado */
.status-indicator {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-bg-light);
    border-radius: 8px;
}

.pulse {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    box-shadow: 0 0 0 rgba(72, 187, 120, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

/* Contenido de Gráficas */
.dashboard-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.dashboard-header .btn-white {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: var(--color-white);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.chart-card-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--color-text-main);
}

.chart-card-header .unit {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
    background: var(--color-bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.echart-container {
    width: 100%;
    height: 300px;
}

/* Responsive Dashboard */
@media (max-width: 992px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    
    .status-indicator {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dashboard-sidebar {
        flex-direction: column;
    }
}
