/* =======================================================
   Estilos Base para Secciones de Contenido
======================================================= */


#cos-section .section-header{
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  position: absolute; /* Changed from sticky to absolute */
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

#reporte-section .section-header{
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  position: absolute; /* Changed from sticky to absolute */
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

/* Cambios en section-header */
.section-header {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0a0550 0%, #140A9A 60%, #1F14B3 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  position: absolute; /* Changed from sticky to absolute */
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
}

/* Estandarización del icono en section-header */
.section-header i {
  font-size: 24px;
  color: white;
  margin-right: 15px;
  flex-shrink: 0;
}

/* Estandarización del título en section-header */
.section-header h2 {
  font-size: 22px;
  color: white;
  margin: 0;
  font-weight: 600;
}

/* Period indicator en el header (si está presente) */
.period-indicator {
  margin-left: auto;
  font-size: 14px;
  opacity: 0.9;
}


/* Indicador de scroll */
.scroll-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  color: var(--primary);
  opacity: 0.6;
  z-index: 5;
  animation: scrollIndicator 1.5s infinite;
  text-align: center;
  font-size: 18px;
  pointer-events: none;
}

@keyframes scrollIndicator {
  0% {
    transform: translateY(0) translateX(-50%);
    opacity: 0.6;
  }
  50% {
    transform: translateY(5px) translateX(-50%);
    opacity: 1;
  }
  100% {
    transform: translateY(0) translateX(-50%);
    opacity: 0.6;
  }
}

/* Animaciones para la transición entre secciones */
.content-section {
  transition: opacity 0.3s ease;
}

.content-section.entering {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sectionFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Asegurar que los charts container funcionen correctamente */
#charts-container {
  position: absolute;
  top: var(--top-bar-height);
  left: 0;
  right: 0;
  bottom: var(--footer-height);
  overflow: hidden;
  margin-top: 30px;
  margin-bottom: 30px;
  padding: 30px;
}

.content.sidebar-open #charts-container {
  left: 250px;
}

/* ================= EFECTO "FADE IN" ===================== */

.section-content {
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0px); }
}

/* Simplificar las animaciones para evitar duplicados */
.section-content {
  animation: smoothFadeIn 1.5s ease-out forwards;
}

/* Mantener solo el floating en section-text */
.section-text {
  animation: float 3s ease-in-out infinite;
  animation-delay: 1.5s; /* Comenzar después de que termine el fade in */
}



/* Redefinir con más duración */
@keyframes smoothFadeIn {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0px); }
}

/* ================= animaciones para iconos =================

/* Keyframes para las diferentes animaciones de iconos */

/* Animación de pulso */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Animación de rotación */
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Animación de rebote */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Animación de balanceo */
@keyframes swing {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(-10deg);
  }
}

/* Animación de destello */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Aplicación de animaciones a iconos específicos basados en su función */

/* Animación base para todos los iconos en section-header */
.section-header i {
  display: inline-block;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  transform-origin: center;
  animation-fill-mode: both;
}

/* Asignar diferentes animaciones según el tipo de ícono */

/* Iconos generales (por defecto): pulso suave */
.section-header i {
  animation-name: pulse;
}

/* Iconos de navegación y ubicación */
.section-header i.fa-compass,
.section-header i.fa-map,
.section-header i.fa-location-arrow,
.section-header i.fa-directions,
.section-header i.fa-road {
  animation-name: rotate;
  animation-duration: 8s; /* Más lento para la rotación */
}

/* Iconos relacionados con personas y equipos */
.section-header i.fa-users,
.section-header i.fa-user-tie,
.section-header i.fa-user-friends,
.section-header i.fa-hands-helping {
  animation-name: bounce;
}

/* Iconos relacionados con logros y metas */
.section-header i.fa-trophy,
.section-header i.fa-award,
.section-header i.fa-medal,
.section-header i.fa-star {
  animation-name: swing;
}

/* Iconos de alerta o importantes */
.section-header i.fa-exclamation-circle,
.section-header i.fa-bell,
.section-header i.fa-info-circle,
.section-header i.fa-lightbulb {
  animation-name: blink;
  animation-duration: 2s; /* Más rápido para el destello */
}

/* Iconos específicos con animaciones personalizadas */
.section-header i.fa-cogs {
  animation-name: rotate;
  animation-duration: 10s;
}

.section-header i.fa-chart-line,
.section-header i.fa-chart-bar,
.section-header i.fa-chart-pie {
  animation-name: bounce;
}

.section-header i.fa-bullseye {
  animation-name: pulse;
  animation-duration: 2s;
}

.section-header i.fa-hard-hat {
  animation-name: bounce;
}

/* Pausa de la animación al hacer hover sobre el icono */
.section-header:hover i {
  animation-play-state: paused;
}


/* Aplicar animación a los títulos de sección */
.section-header {
  background: var(--gradient-animated);
  background-size: 400% 400%;
  animation: gradientAnimation 5s ease infinite; /* cambiar velocidad de gradient */
}

/* Aplicar animación a los títulos de sección */
#cos-section .section-header {
  background: var(--gradient-animated-cos);
  background-size: 400% 400%;
  animation: gradientAnimation 5s ease infinite; /* cambiar velocidad de gradient */
}

#reporte-section .section-header {
  background: var(--gradient-animated-reporte);
  background-size: 400% 400%;
  animation: gradientAnimation 5s ease infinite; /* cambiar velocidad de gradient */
}

/* Corregir la sección de contenido para eliminar espacios innecesarios */
.content-section {
  position: relative;
  margin-top: 60px;
  overflow-y: auto;
}

/* Ajustar el contenido para que tenga scroll y no genere espacio adicional */
.section-content {
  background-color: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding-top: 70px;
  padding-left: 20px;
  padding-right: 20px;
  overflow-y: auto;
  width: 100%;
  position: relative;
}

/* Asegurar que el header de sección se mantenga fijo y visible */
.section-header {
  display: flex;
  align-items: center;
  background: var(--gradient-animated);
  background-size: 400% 400%;
  animation: gradientAnimation 5s ease infinite !important;
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
}

/* Estilos específicos para headers de cos-section y reporte-section */
#cos-section .section-header {
  background: var(--gradient-animated-cos) !important;
  background-size: 400% 400% !important;
  animation: gradientAnimation 5s ease infinite !important;
}

#reporte-section .section-header {
  background: var(--gradient-animated-reporte) !important;
  background-size: 400% 400% !important;
  animation: gradientAnimation 5s ease infinite !important;
}

/* Ajustar el indicador de scroll para que no interfiera con el contenido */
.scroll-indicator {
  position: absolute;
  bottom: var(--footer-height);
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  color: var(--primary);
  opacity: 0.6;
  z-index: 5;
  animation: scrollIndicator 1.5s infinite;
  text-align: center;
  font-size: 18px;
  pointer-events: none;
}

/* Asegurar que el charts container también respete el espacio del footer */
#charts-container {
  padding-bottom: var(--footer-height);
  overflow-y: auto;
}

/* Eliminar la flecha de scroll que aparece en la parte inferior */
.scroll-indicator {
  display: none !important;
}

/* --- AL FINAL DE content_sections.css --- */

/* Contenedor de sección ocupa todo el alto disponible */
.content-section {
  position: relative; /* para que el header absoluto esté bien posicionado */
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--top-bar-height) - var(--footer-height));
  padding-bottom: 60px;
}

/* El contenido interno crece, y si excede su área muestra scroll */
.section-content {
  flex: 1;                  /* ocupa todo el espacio restante */
  overflow-y: auto;         /* habilita scroll vertical */
  padding: 30px;        /* igual a la altura de .section-header */
  padding-top: 80px;
  box-sizing: border-box;
}

/* Opcional: personalizar indicador visual de scroll */
.section-content::-webkit-scrollbar {
  width: 6px;
}
.section-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

