/* ========= 🌾 Portal Ebrenc - portal.css (Unified) ========= */

/* =========================================
   1. BASE STYLES & PREVIOUS CONFIG
   ========================================= */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #212529;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Background is handled dynamically in the page */
  overflow-x: hidden;
  /* Evita scroll lateral indeseado */
  width: 100%;
}

.header-bg {
  /* Fallback/Original */
  background: linear-gradient(135deg, #e8f5ff 0%, #b1bcf1, #d49725 100%);
}

.test-wrapper {
  max-width: 800px;
  margin: auto;
  padding: 20px;
}

.disclaimer {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85) !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 10px;
}

/* =========================================
   2. COMPONENTS (HEADER, CARDS, FOOTER)
   ========================================= */

/* Glassmorphism Avanzado para el Header */
/* Glassmorphism Avanzado para el Header */
.header-custom {
  background: rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  padding-bottom: .25rem;
  /* CRITICO: Z-Index para que el menú quede por encima del contenido */
  position: relative;
  z-index: 1050;
}

.orgull {
  font-family: 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 24px;
  font-weight: 700;
  margin-left: 8px;
  display: inline-block;
  vertical-align: bottom;
  line-height: 1;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Mejora contraste logo azul sobre fondo oscuro */
.navbar-brand img {
  filter: drop-shadow(0 1px 0px rgba(255, 255, 255, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Glassmorphism para el contenedor principal */
/* Glassmorphism para el contenedor principal */
.main-glass-container {
  color: #f8fafc;
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 1rem !important;
}

@media (min-width: 768px) {
  .main-glass-container {
    background: rgba(255, 255, 255, 0.01) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin-top: 3rem;
    margin-bottom: 3rem;
    padding: 2.5rem !important;
  }
}

/* Glassmorphism Card (Shared) */
.glass-card {
  background: linear-gradient(145deg, rgba(40, 55, 90, 0.5), rgba(10, 25, 50, 0.75)) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 24px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: linear-gradient(145deg, rgba(60, 80, 120, 0.6), rgba(20, 35, 60, 0.85)) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  transform: translateY(-2px);
}

/* Targetas de funcionalidades con efecto traslúcido y elevación */
.feature-card {
  background: linear-gradient(145deg, rgba(40, 55, 90, 0.6), rgba(10, 25, 50, 0.75)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.05);
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

/* Tipografía optimizada para fondo oscuro/glass */
.card-title,
.h5,
.video-caption {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Clase de utilidad para sombra pro en header */
.text-shadow-pro {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

.card-text.text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Iconos de las targetas */
.feature-emoji {
  font-size: 2.2rem;
  line-height: 1;
  margin-right: .75rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.feature-card:hover .feature-emoji {
  transform: scale(1.3) rotate(8deg);
}

/* Navegación (Pills) adaptadas al estilo glass */
.header-custom .nav-link {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
  margin-left: 10px !important;
  transition: all 0.3s ease;
  border-radius: 20px;
  padding: 6px 14px !important;
  font-weight: 600;
}

.header-custom .nav-link:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #ffd43b !important;
  /* Toque dorado para resaltar en hover */
  transform: translateY(-2px);
}

/* Líneas divisorias suaves */
hr {
  border-color: rgba(255, 255, 255, 0.2) !important;
  opacity: 1;
  margin: 2rem 0;
}

/* Video Section */
.video-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.video-container iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}

.video-caption {
  margin-top: 0.3rem;
  font-size: 1rem;
  font-style: italic;
  text-align: center;
}

.video-caption::before {
  color: #e63946;
  font-style: normal;
  font-weight: bold;
}

/* =========================================
   3. FOOTER META & SIGNATURE
   ========================================= */
footer.portal-footer {
  background: #2c3e50;
  /* Override for premium look if needed, but keeping logical structure */
  background: rgba(0, 0, 0, 0.3);
  /* Let background show through a bit? Or keep solid? Keeping simple. */
  color: #adb5bd;
  padding: 12px;
  font-size: 0.8rem;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

footer.portal-footer a {
  color: #adb5bd;
  text-decoration: none;
}

footer.portal-footer a:hover {
  text-decoration: underline;
}

.meta {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.meta-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: rgba(255, 255, 255, 0.4);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-sep {
  color: rgba(255, 255, 255, 0.15);
  font-weight: 300;
}

.crafted-by {
  display: block;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.58rem;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.4;
}


/* =========================================
   4. SCREENSAVER MODE
   ========================================= */
/* MODO SCREENSAVER */
#bg-animate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Color de seguridad (azul oscuro profundo) por si falla la imagen */
  background-color: #0f172a;
  /* Imagen dinámica via variable CSS */
  background-image: var(--bg-full);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 2s ease-in-out;
}

/* kenBurns removed as it's replaced by backgroundDrift below */

/* MODO SCREENSAVER OPTIMIZADO */
body.screensaver-active main,
body.screensaver-active footer {
  opacity: 0;
  pointer-events: none;
  filter: blur(30px);
  transform: scale(0.92);
  transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* El Header se mantiene visible (logo + botón sol) pero ocultamos el menú */
body.screensaver-active header {
  opacity: 1;
  /* Visible! */
  background: transparent !important;
  /* Más limpio */
  border-bottom: none !important;
  box-shadow: none !important;
  transition: all 1s ease;
}



/* Botón Sol Header (Delicado y Proporcional) */
.sun-header-btn,
.sun-header-btn:hover,
.sun-header-btn:focus,
.sun-header-btn:active {
  text-decoration: none !important;
  outline: none !important;
}

.sun-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  /* Approx 30% larger than previous 48-50ish */
  height: 62px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  outline: 1px solid rgba(255, 220, 0, 0.2);
  outline-offset: 3px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 18px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 200, 0, 0.2);
}

.sun-emoji-inner {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 220, 0, 0.7));
  transition: all 0.4s ease;
  user-select: none;
}

.sun-header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 200, 0, 0.2);
}

.sun-header-btn:hover .sun-emoji-inner {
  transform: rotate(20deg) scale(1.15);
  filter: drop-shadow(0 0 15px rgba(255, 220, 0, 0.9));
}

.sun-header-btn:active {
  transform: translateY(0) scale(0.92);
}

.sun-icon-img {
  transition: all 0.5s ease;
  opacity: 1;
  animation: sunAura 60s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(255, 255, 100, 0.6));
}

.screensaver-standalone:hover .sun-icon-img {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(255, 255, 200, 1)) drop-shadow(0 0 20px rgba(255, 200, 0, 0.9)) drop-shadow(0 0 50px rgba(255, 100, 0, 0.8));
}

@keyframes sunAura {

  0%,
  100% {
    transform: translateX(0) scale(1.3);
    /* Base scale a bit larger */
  }

  50% {
    transform: translateX(-15vw) scale(1.6);
  }
}

/* Estado activo del botón sol (cuando estamos en screensaver) */
body.screensaver-active .sun-header-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.screensaver-active .sun-icon-img {
  width: 10% !important;
  max-width: 130px !important;
  height: auto !important;
  filter: drop-shadow(0 0 15px rgba(255, 200, 0, 0.8));
}

body.screensaver-active .sun-emoji-inner {
  font-size: 4rem !important;
  /* Huge emoji if used instead of image */
}

header,
main,
footer {
  transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}

/* =========================================
   5. MOBILE FIXES
   ========================================= */
@media (max-width: 991.98px) {
  .navbar-custom .navbar-collapse {
    background: linear-gradient(135deg, rgba(17, 24, 39, .98), rgba(30, 41, 59, .98));
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    margin: .5rem 1rem;
    padding: .5rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    /* Priority over header (1050) and main content */
  }

  .navbar-custom .navbar-nav .nav-link {
    color: #f8fafc !important;
    background: transparent !important;
    border-radius: 10px;
    text-shadow: none !important;
    margin-left: 0 !important;
    padding: .8rem 1rem !important;
    font-size: 1rem;
  }

  .navbar-custom .navbar-nav .nav-link:hover,
  .navbar-custom .navbar-nav .nav-link:focus {
    background: rgba(255, 255, 255, .08) !important;
    color: #ffffff !important;
  }

  .navbar-custom .navbar-nav .nav-link.active {
    background: rgba(43, 115, 255, .28) !important;
    color: #ffffff !important;
    font-weight: 700;
  }

  .navbar-custom .navbar-nav .nav-item+.nav-item {
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
}

/* === CARRUSEL DINÁMICO MENU (Desktop) === */
/* === CARRUSEL / SLIDER (Desktop) === */
/* === NUEVO CARRUSEL CENTRAL (Showcase) === */
.carousel-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.carousel-icon .icon-img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

.carousel-title {
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.carousel-desc {
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 300;
}

/* Ajustes Navbar para el menú colapsable absoluto */
.navbar-custom {
  position: relative;
}

.navbar-collapse {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px !important;
  background: rgba(20, 30, 50, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 1rem;
  border-radius: 0 0 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2000;
}

/* Forzar ancho completo en items del dropdown */
.navbar-collapse .nav-item {
  width: 100%;
  display: block;
}

.navbar-collapse .nav-link {
  width: 100%;
  display: block;
  text-align: left;
  /* Alinear a la izquierda */
  margin-left: 0 !important;
  /* Reset de estilos anteriores */
  margin-bottom: 5px;
}

.navbar-collapse .nav-link img,
.navbar-collapse .nav-link .icon-img {
  height: 24px !important;
  width: auto !important;
  vertical-align: middle;
  margin-right: 8px;
}

/* CAROUSEL NAV ARROWS (Discreet & Elegant) */
.carousel-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  width: 32px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0;
}

.carousel-nav-arrow:hover {
  color: #fff;
  transform: translateY(-50%) scale(1.2);
}

.carousel-nav-arrow svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6));
}

.carousel-nav-arrow.prev {
  left: 0;
}

.carousel-nav-arrow.next {
  right: 0;
}

#headerCarouselContainer:hover .carousel-nav-arrow {
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1200px) {
  #headerCarouselContainer {
    margin-left: 2rem !important;
    margin-right: 2rem !important;
  }

  .carousel-nav-arrow.prev {
    left: -15px;
  }

  .carousel-nav-arrow.next {
    right: -15px;
  }
}


/* =========================================
   6. BACKGROUND ANIMATION (SCREENSAVER)
   ========================================= */
#bg-animate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  background-size: cover;
  background-position: center;
  transition: all 1s ease;
  will-change: transform;
}

/* Animación de deriva lenta para el screensaver */
@keyframes backgroundDrift {
  0% {
    transform: scale(1) translate(0, 0);
  }

  /* Fase 0: Inicio suave y progresivo */
  10% {
    transform: scale(1.08) translate(0.2%, 0.2%);
  }

  /* Fase 1: Deriva lateral con zoom sostenido */
  30% {
    transform: scale(1.15) translate(-2%, 1%);
  }

  /* Fase 2: Zoom In central moderado */
  50% {
    transform: scale(1.25) translate(0.5%, -1.5%);
  }

  /* Fase 3: Retroceso y deriva opuesta */
  75% {
    transform: scale(1.18) translate(2%, 0.5%);
  }

  /* Fase 4: Final de ciclo con zoom máximo contenido */
  100% {
    transform: scale(1.3) translate(0, 0);
  }
}

body.screensaver-active #bg-animate {
  animation: backgroundDrift 60s infinite ease-in-out alternate;
}



.navbar-custom .navbar-toggler {
  border-color: rgba(255, 255, 255, .55);
}

.navbar-custom .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}