/* ============================================================================
   STYLES.CSS - ESTILOS ESPECÍFICOS PARA LA PÁGINA HOME
   ============================================================================ */

/* ============================================================================
   HERO SECTION Y CAROUSEL
   ============================================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #0f172a; /* Color de fondo por si quedan espacios */
}

/* ✅ CORREGIDO: Overlay más suave y menos opaco */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.3) 0%, rgba(30, 41, 59, 0.2) 100%);
  z-index: 1;
}

/* ✅ CORREGIDO: Imagen MÁS ALEJADA para evitar recortes */
.carousel-item img {
  width: 100%;
  height: 100vh;
  object-fit: contain; /* Muestra la imagen completa */
  object-position: center;
  /* CLAVE: Alejar más la imagen para evitar recortes */
  transform: scale(0.75); /* Ajusta entre 0.7 - 0.9 según necesites */
  filter: brightness(1.1) contrast(1.2) saturate(1.1);
  transition: all 0.8s ease;
}

/* ✅ OPCIONAL: Efecto hover muy sutil */
.carousel-item:hover img {
  transform: scale(0.88); /* Zoom muy sutil en hover */
  filter: brightness(1.2) contrast(1.3) saturate(1.2);
}

.carousel-caption {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: none;
}
.caption-card {
  max-width: 600px;
  animation: slideInUp 1.2s ease-out;
  /* ✅ AGREGADO: Sombra más sutil para el texto */
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.caption-card h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  /* ✅ MEJORADO: Sombra más definida para contraste */
  text-shadow: 0 4px 20px rgba(0,0,0,0.8), 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 1.5rem;
}

.caption-card p {
  font-size: 1.25rem;
  /* ✅ MEJORADO: Sombra más definida para legibilidad */
  text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.5);
  margin-bottom: 2rem;
}

/* ============================================================================
   CAROUSEL INDICATORS PERSONALIZADOS
   ============================================================================ */

.carousel-indicators {
  bottom: 30px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.carousel-indicators button {
  width: 55px;
  height: 6px;
  border-radius: 4px;
  border: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.25), rgba(255,255,255,0.5));
  cursor: pointer;
  position: relative;
  transition: all 0.4s ease;
  overflow: hidden;
}

.carousel-indicators button:hover {
  transform: scale(1.15);
  background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.8));
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

.carousel-indicators button.active {
  background: linear-gradient(270deg, var(--primary-color), #60a5fa, var(--primary-color));
  background-size: 300% 300%;
  animation: gradientShift 5s ease infinite, pulseIndicator 0.8s ease-out;
  box-shadow: 0 0 25px rgba(37, 99, 235, 0.9);
  transform: scale(1.25);
}

.carousel-indicators button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.9);
  animation: progressFill 6s linear forwards;
}

/* ============================================================================
   STATS SECTION
   ============================================================================ */

.stats-section {
  position: relative;
  z-index: 2;
  margin-top: -60px;
  padding-bottom: 4rem;
}

.stats-counter {
  font-size: 3rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.3));
}

/* ============================================================================
   SECCIONES ESPECÍFICAS DEL HOME
   ============================================================================ */

.section-modern {
  padding: 6rem 0;
  position: relative;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

.gradient-divider {
  width: 100px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  margin: 2rem auto;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
}

/* ============================================================================
   EXPERTISE CARDS ESPECÍFICAS
   ============================================================================ */

.expertise-card {
  height: 100%;
  padding: 2rem;
  transition: all 0.4s ease;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(10px);
}

.expertise-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-glow-primary);
  transition: all var(--animation-duration-fast) ease;
}

.expertise-icon i {
  font-size: 1.5rem;
  color: white;
}

.expertise-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59, 130, 246, 0.4);
}

.expertise-card:hover .expertise-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
}

/* ============================================================================
   VIDEO SECTION
   ============================================================================ */

.video-section {
  background: var(--gradient-bg);
  padding: 6rem 0;
}

.video-container {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.video-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: 22px;
  z-index: -1;
}

/* ============================================================================
   PARTNERS SECTION - CORREGIDO
   ============================================================================ */

.partners-section {
  padding: 4rem 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
}

.partners-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 3rem;
}

.logos-container {
  overflow: hidden;
  padding: 1rem 0;
  /* Máscara mejorada */
  mask: linear-gradient(90deg, transparent 0%, white 10%, white 90%, transparent 100%);
  -webkit-mask: linear-gradient(90deg, transparent 0%, white 10%, white 90%, transparent 100%);
}

.logos-slide {
  display: flex;
  /* Animación más lenta y suave */
  animation: scrollLogos 90s linear infinite;
  /* Ancho automático basado en contenido */
  width: fit-content;
}

.logo-item {
  flex-shrink: 0;
  /* CLAVE: Ancho fijo para consistencia */
  width: 180px;
  height: 80px;
  margin: 0 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--animation-duration-fast) ease;
  /* CLAVE: Centrar contenido */
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-5px);
}

.logo-img-partner {
  max-height: 40px;
  max-width: 140px;
  opacity: 0.8;
  filter: grayscale(100%) brightness(2);
  transition: all var(--animation-duration-fast) ease;
  object-fit: contain;
}

.logo-item:hover .logo-img-partner {
  opacity: 1;
  filter: grayscale(0%) brightness(1);
}

/* CLAVE: Keyframe corregido */
@keyframes scrollLogos {
  0% {
    transform: translateX(0);
  }
  100% {
    /* Se mueve exactamente la mitad del ancho total */
    transform: translateX(-50%);
  }
}

/* Hover para pausar */
.logos-slide:hover {
  animation-play-state: paused;
}

/* Responsive */
@media (max-width: 768px) {
  .logo-item {
    width: 150px;
    margin: 0 0.5rem;
  }
  
  .logos-slide {
    animation-duration: 35s;
  }
}

/* ============================================================================
   ANIMACIONES ESPECÍFICAS DEL HOME
   ============================================================================ */

.home-animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all var(--animation-duration-slow) cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

.home-animate-on-scroll.animate,
.home-animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Delays escalonados para el home */
.home-stagger-1 { transition-delay: 0.1s; }
.home-stagger-2 { transition-delay: 0.2s; }
.home-stagger-3 { transition-delay: 0.3s; }
.home-stagger-4 { transition-delay: 0.4s; }
.home-stagger-5 { transition-delay: 0.5s; }
.home-stagger-6 { transition-delay: 0.6s; }

/* ============================================================================
   KEYFRAMES ESPECÍFICOS DEL HOME
   ============================================================================ */

@keyframes scrollLogos {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulseIndicator {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1.25); }
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ============================================================================
   RESPONSIVE ESPECÍFICO PARA HOME
   ============================================================================ */

@media (max-width: 768px) {
  .caption-card h1 { 
    font-size: 2.5rem; 
  }
  
  .caption-card p { 
    font-size: 1.1rem; 
  }
  
  .section-title { 
    font-size: 2rem; 
  }
  
  .stats-counter { 
    font-size: 2.5rem; 
  }
  
  .expertise-card { 
    padding: 1.5rem; 
  }
  
  .carousel-indicators button {
    width: 45px;
    height: 5px;
  }
  
  .section-modern {
    padding: 4rem 0;
  }
  
  .stats-section {
    margin-top: -40px;
  }
}

@media (max-width: 576px) {
  .caption-card h1 { 
    font-size: 2rem; 
  }
  
  .hero {
    min-height: 80vh;
  }
  
  .carousel-item img {
    height: 80vh;
  }
  
  .logos-slide {
    animation-duration: 20s;
  }
}

/* ============================================================================
   ACCESIBILIDAD Y MEJORAS ESPECÍFICAS DEL HOME
   ============================================================================ */

/* Focus styles para elementos específicos del home */
.carousel-control-prev:focus-visible,
.carousel-control-next:focus-visible,
.carousel-indicators button:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .logos-slide {
    animation: none;
  }
  
  .carousel-indicators button.active {
    animation: none;
  }
  
  .carousel-item img {
    transition: none;
  }
}

/* Optimizaciones de rendimiento */
.carousel-item {
  will-change: transform;
}

.logos-slide {
  will-change: transform;
}

.expertise-card,
.logo-item {
  will-change: transform, box-shadow;
}

/* ============================================================================
   ESTADOS DE CARGA ESPECÍFICOS
   ============================================================================ */

.video-loading {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 20px;
}

.video-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid rgba(37, 99, 235, 0.3);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ============================================================================
   MICROINTERACCIONES ESPECÍFICAS DEL HOME
   ============================================================================ */

.stats-counter {
  transition: all 0.3s ease;
}

.stats-counter:hover {
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}

.section-title:hover {
  text-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
  transition: text-shadow 0.3s ease;
}

/* Efectos de hover para botones del carousel */
.carousel-control-prev,
.carousel-control-next {
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: rgba(37, 99, 235, 0.8);
  transform: translateY(-50%) scale(1.1);
}

/* ============================================================================
   OVERLAYS Y EFECTOS ESPECIALES
   ============================================================================ */

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%);
  z-index: 1;
}

.expertise-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: 18px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.expertise-card:hover::before {
  opacity: 0.1;
}

/* ============================================================================
   TEXTO Y TIPOGRAFÍA ESPECÍFICA
   ============================================================================ */

.hero .display-4 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.hero .lead {
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.95;
}

.section-modern .h2 {
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ============================================================================
   UTILIDADES ESPECÍFICAS DEL HOME
   ============================================================================ */

.home-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.home-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.home-col {
  flex: 1;
  padding: 0 15px;
  min-width: 0;
}

@media (max-width: 768px) {
  .home-col {
    flex: 100%;
    margin-bottom: 2rem;
  }
}

/* ============================================================================
   COMPATIBILIDAD CON OTRAS PÁGINAS
   ============================================================================ */

/* Aseguramos que estos estilos no interfieran con otras páginas */
/*body.home-page .animate-on-scroll {
  /* Los estilos del home no afectarán otras páginas
}

/* Namespace específico para evitar conflictos 
.page-home .carousel,
.page-home .stats-section,
.page-home .expertise-card,
.page-home .video-section,
.page-home .partners-section {
  /* Estilos específicos solo para la página home 
}*/