@import url('https://fonts.googleapis.com/css?family=Titillium Web');
/* assets/css/styles.css */
:root {
    --primary-color: #549db4;
    --secondary-color: #fd1100b0;
    --accent-color: #ffffff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-image: url('../../assets/img/hero-bg-light.webp');
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;

    background-size: cover;
    
    /* Centra la imagen */
    background-position: center center;
    
    /* Evita que la imagen se repita */
    background-repeat: no-repeat;
    
    /* Fija la imagen para que no se mueva al hacer scroll */
    background-attachment: fixed;
    
    /* Asegura que el fondo cubra todo el viewport */
    min-height: 100vh;
    
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Capa blanca semitransparente */
    z-index: -1;
    pointer-events: none;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    font-size: 1.25rem;
    font-weight: normal;
}

.logo img {
    height: 50px;
  /* Ajusta la altura según el tamaño de tu logotipo */
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.932));

}

.header-right .btn-primary {
    background: #549db4;
    border: 1px solid rgb(255, 255, 255);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-right .btn-primary:hover {
    background: #daedf3;
    transform: translateY(-1px);
    color: var(--black);
}



/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.25rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
}

.nav-link i {
    font-size: 1.5rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.expand-icon {
    margin-left: auto;
    font-size: 10px;
    transition: var(--transition);
}

.nav-link.expanded .expand-icon {
    transform: rotate(180deg);
}

.sub-nav {
    list-style: none;
    background-color: var(--gray-50);
    border-left: 3px solid var(--primary-color);
    margin-left: 1.25rem;
    overflow: hidden;
    max-height: 0;
    transition: var(--transition);
}

.sub-nav.expanded {
    max-height: 200px;
}

.sub-nav-item {
    border-bottom: 1px solid var(--gray-200);
}

.sub-nav-item:last-child {
    border-bottom: none;
}

.sub-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
}

.sub-nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

.sub-nav-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Main Content Styles */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    transition: var(--transition);
}

.main-content.expanded {
    margin-left: 70px;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard Styles */
.dashboard {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    font-size: 1.125rem;
    color: var(--gray-600);
}

/* Cards Styles */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    /*text-transform: uppercase;*/
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}


.card-value .number {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--gray-900);
}


.card-value {
    display: flex;
    flex-direction: column; /* Cambia la dirección de los elementos hijos a columna */
    align-items: flex-start; /* Alinea los elementos a la izquierda */
}

.number {
    font-size: 2em; /* Tamaño de fuente para el número actual */
    font-weight: bold; /* Negrita para el número actual */
    margin: 0; /* Elimina el margen predeterminado */
}

.previous-year {
    font-size: 0.8em; /* Tamaño de fuente más pequeño para el año anterior */
    color: #666; /* Color más claro para el año anterior */
    margin-top: 0.25em; /* Espacio entre el número actual y el año anterior */
}


.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.3rem;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.percentage {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.percentage.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.percentage.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.comparison-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

#comparativoGeneralChart,
#comparativoIIEEChart {
    width: 100% !important;
    height: 100% !important;
}

/* Charts Styles */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

.chart-card {
    display: flex;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    width: 100%;
    height: 500px; /* O la altura que desees */
    position: relative;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.chart-header p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.chart-content {
    position: relative;
    height: 100%; /* Ajusta la altura según sea necesario */
    width: 100%;
    overflow: hidden;
}

.chart-content canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

}

#studentsDistrictChart {
    max-width: 100%;
    max-height: 380px;
    width: 100%;
    height: auto;
}

/* Loading Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}



/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .nav-text {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }
    
    .logo span {
        display: none;

    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-content {
        height: 300px;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .chart-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 0.75rem;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .card-value .number {
        font-size: 1.5rem;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .dashboard-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-header p {
        font-size: 1rem;
    }
    
    .chart-content {
        height: 250px;
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-in-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll customization */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Focus styles for accessibility */
button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --gray-100: #e0e0e0;
        --gray-200: #c0c0c0;
        --gray-300: #a0a0a0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn-refresh {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-refresh:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.btn-refresh:active {
    transform: scale(0.95);
}

.btn-refresh i {
    font-size: 16px;
}

/* Animación para el icono de refresh */
.btn-refresh.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Estilos para notificaciones de error */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-content button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.error-content button:hover {
    background: rgba(255,255,255,0.2);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mejorar la animación de números */
.card-value .number {
    font-weight: bold;
    font-size: 2em;
    color: #1f2937;
    transition: all 0.3s ease;
}

/* Colores dinámicos para porcentajes */
.percentage {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.previous-year {
    display: block;
    font-size: 0.8em; /* Tamaño de fuente más pequeño */
    color: #666; /* Color más claro para indicar que es un valor secundario */
    margin-top: 0.5em; /* Espacio entre el valor actual y el del año anterior */
}

/* Estados de carga para cards */
.card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.card.loading .card-value .number::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

/* Mejorar el overlay de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    text-align: center;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .btn-refresh {
        width: 36px;
        height: 36px;
        top: 5px;
        right: 5px;
    }
    
    .error-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

#mensajeError {
    display: none;
    padding: 12px;
    background-color: #ffe0e0;
    border: 1px solid #ff4d4d;
    color: #a94442;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* Contenedor principal de filtros */
.filtros-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background-color: #f9fafb;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Cada select con su label */
.filtro-item {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 180px;
  font-size: 12px;
}

/* Estilo para labels */
.filtro-item label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

/* Estilo para los selects */
.filtro-item select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  transition: border-color 0.2s ease-in-out;
}

.filtro-item select:focus {
  outline: none;
  border-color: #3b82f6; /* Azul */
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.filtro-boton {
  display: flex;
  align-items: end;
}

.filtro-boton button {
  padding: 10px 20px;
  background-color: #3b82f6; /* Azul */
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.filtro-boton button:hover {
  background-color: #2563eb; /* Azul más oscuro */
}

.grafico-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
}

#resultadosIEChart {
  width: 100%;
  height: 280px; /* o el tamaño que tú desees */
  display: block;
  box-sizing: border-box;
}


.custom-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
}

.custom-legend .legend-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
}

.custom-legend .legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 6px;
  display: inline-block;
}

