/* === css/styles.css === */
:root {
  --bs-body-font-family: "Inter", sans-serif;
  --brand-blue: #0057a4;
  --brand-yellow: #ffd23f;
}
#network-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.chat-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.glass-effect {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.212);
}
[data-bs-theme="dark"] .glass-effect {
  background: rgba(15, 23, 42, 0.904);
  color: #fff;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}
.message-row {
  display: flex;
  margin-bottom: 1rem;
  opacity: 0;
  animation: popIn 0.3s forwards;
}
.message-row.user {
  justify-content: flex-end;
}
.bubble {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.message-row.bot .bubble {
  background: rgba(0, 87, 164, 0.1);
  border-bottom-left-radius: 4px;
  color: var(--bs-body-color);
}
[data-bs-theme="dark"] .message-row.bot .bubble {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.message-row.user .bubble {
  background: var(--brand-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
  border: 2px solid var(--brand-yellow);
}

/* Quiz Reveal */
.quiz-reveal-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  background: rgba(128, 128, 128, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  user-select: none;
}
.reveal-btn {
  cursor: pointer;
  border: none;
  background: var(--brand-blue);
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  flex-shrink: 0;
}
.reveal-btn:active,
.reveal-btn.active {
  transform: scale(0.95);
  background: var(--brand-yellow);
  color: black;
}
.hidden-answer {
  filter: blur(8px);
  opacity: 0.5;
  transition: all 0.2s ease;
  margin-left: 5px;
  pointer-events: none;
}
.hidden-answer.revealed {
  filter: blur(0);
  opacity: 1;
  font-weight: bold;
  color: #198754;
  pointer-events: auto;
}

/* UI Archivos */
#file-loading-state {
  display: none;
  font-size: 0.85rem;
  color: var(--brand-blue);
  margin-bottom: 10px;
  text-align: center;
}
.file-actions {
  display: none;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
  animation: popIn 0.3s ease;
}
.btn-action {
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  background: rgba(255, 255, 255, 0.5);
  transition: 0.2s;
  cursor: pointer;
  font-weight: 500;
}
.btn-action:hover {
  background: var(--brand-blue);
  color: white;
  transform: translateY(-2px);
}
.chat-footer {
  padding: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.6);
}
.file-badge {
  font-size: 0.8rem;
  background-color: var(--brand-yellow);
  color: #000;
  padding: 5px 12px;
  border-radius: 12px;
  display: none;
  align-items: center;
  margin-bottom: 8px;
  width: fit-content;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* === ESTILOS GENERALES === */
.text-brand-blue {
  color: var(--brand-blue) !important;
}
.text-brand-yellow {
  color: var(--brand-yellow) !important;
}
.bg-brand-blue {
  background-color: var(--brand-blue) !important;
}
.bg-brand-yellow {
  background-color: var(--brand-yellow) !important;
  color: #000;
}

/* Nav pills lateral */
.nav-pills .nav-link {
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
  margin-bottom: 8px;
}
.nav-pills .nav-link.active {
  background-color: var(--brand-blue) !important;
  box-shadow: 0 4px 15px rgba(var(--brand-blue-rgb), 0.3);
  color: #fff !important;
}

/* Cards */
.card {
  border-radius: 16px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.hover-scale:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Tabs para series, etc. */
.nav-tabs {
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}
.nav-tabs .nav-link {
  border: none;
  opacity: 0.6;
  font-weight: 600;
  padding: 1rem 1.5rem;
  position: relative;
}
.nav-tabs .nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--brand-blue);
  transition: width 0.3s ease;
}
.nav-tabs .nav-link.active {
  opacity: 1;
  color: var(--brand-blue) !important;
}
.nav-tabs .nav-link.active::after {
  width: 100%;
}

/* Botón flotante de tema */
.theme-toggle-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1060;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
.theme-toggle-btn:hover {
  transform: scale(1.1) rotate(15deg);
}

/* Animaciones */
.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.delay-1 {
  animation-delay: 0.1s;
}
.delay-2 {
  animation-delay: 0.2s;
}

/* Scroller horizontal de tarjetas (videos recomendados, etc.) */
.scrolling-wrapper {
  overflow-x: auto;
  padding: 10px 5px 25px 5px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 5%,
    black 95%,
    transparent
  );
}
.scrolling-card {
  display: inline-block;
  width: 80%;
  white-space: normal;
  vertical-align: top;
  margin-right: 20px;
  transition: transform 0.3s ease;
}
.scrolling-card:hover {
  transform: scale(1.03);
}
@media (min-width: 768px) {
  .scrolling-card {
    width: 40%;
  }
}
@media (min-width: 992px) {
  .scrolling-card {
    width: 28%;
  }
}

/* === ESTILOS DEL MÓDULO DE TEST === */
.grid-nums {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 0.5rem;
}
.mini-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.mini-legend .answered {
  background: var(--bs-primary);
}
.mini-legend .marked {
  background: var(--bs-warning);
}
.mini-legend .pending {
  background: var(--bs-secondary);
}

.option {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.option:hover {
  background-color: var(--bs-tertiary-bg);
}
.option.active {
  background: color-mix(in oklab, var(--brand-blue) 10%, transparent);
  border-color: var(--brand-blue) !important;
}
.option.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--brand-blue);
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
}

/* Resultados del test */
.rez-score {
  font-weight: 900;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  color: var(--brand-blue);
}
.rez-sub {
  color: var(--bs-secondary-color);
  font-weight: 500;
  font-size: 1.1rem;
}
.answer-card {
  border-left: 5px solid transparent;
}
.answer-card.correct {
  border-left-color: var(--bs-success);
  background-color: rgba(var(--bs-success-rgb), 0.05);
}
.answer-card.incorrect {
  border-left-color: var(--bs-danger);
  background-color: rgba(var(--bs-danger-rgb), 0.05);
}
.rez-correct {
  font-weight: 700;
}

/* Botón IA VIP */
.btn-ia-vip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  transition: all 0.2s ease;
}
.btn-ia-vip:hover {
  background: var(--brand-blue);
  color: #fff;
  border-color: var(--brand-blue);
  transform: scale(1.1);
}

/* Tarjeta VIP animada */
.vip-activo-card .pulsate-star {
  animation: pulsate 1.5s infinite ease-in-out;
}
@keyframes pulsate {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

/* Radios con estilo list-group-item */
.form-check-label.list-group-item {
  cursor: pointer;
}
.form-check-label.list-group-item:hover {
  background-color: var(--bs-tertiary-bg);
}
/* --- Estilos del Botón Súper Cargado --- */
.btn-super-cta {
  position: relative;
  background: linear-gradient(
    45deg,
    #ffc107,
    #ff9800
  ); /* Gradiente Warning mejorado */
  border: none;
  color: #000; /* Texto oscuro para contraste con fondo amarillo */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 15px 40px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1;
}

/* Efecto al pasar el mouse (Hover) */
.btn-super-cta:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 152, 0, 0.6);
  color: #000;
}

/* Brillo interno animado */
.btn-super-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  transition: 0.5s;
  z-index: -1;
}

.btn-super-cta:hover::before {
  left: 100%;
}

/* --- Animación de las Estrellas (bi-stars) --- */

/* Contenedor de iconos para alineación */
.icon-container {
  display: inline-block;
  position: relative;
}

/* Animación para el icono izquierdo */
.star-left {
  animation: float-stars 2s infinite ease-in-out alternate;
  font-size: 1.2rem;
  margin-right: 8px;
  display: inline-block;
  /* Forzamos un color oscuro o rojizo para que se vea sobre el amarillo, 
               o usamos text-white con sombra si el fondo fuera oscuro. 
               Aquí usamos un naranja oscuro para mantener el tono "warning" pero visible. */
  color: #b71c1c;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Animación para el icono derecho */
.star-right {
  animation: spin-pulse 3s infinite linear;
  font-size: 1.4rem;
  margin-left: 8px;
  display: inline-block;
  color: #b71c1c;
}

/* Keyframes: Flotar suavemente */
@keyframes float-stars {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-3px) scale(1.2);
  }
}

/* Keyframes: Girar y pulsar */
@keyframes spin-pulse {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.3);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Partículas extra (destellos) en el fondo del botón */
.btn-super-cta .sparkle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #fff 10%, transparent 60%);
  opacity: 0;
  animation: sparkle-anim 2s infinite;
}
.btn-super-cta .sparkle:nth-child(1) {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}
.btn-super-cta .sparkle:nth-child(2) {
  bottom: 10%;
  right: 20%;
  animation-delay: 1s;
}

@keyframes sparkle-anim {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}
/* para /secciones/vip.php */
.glass-panel {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

#drop-zone {
  border: 2px dashed #cbd5e1;
  transition: 0.3s;
  cursor: pointer;
  background: #f8fafc;
}
#drop-zone:hover {
  border-color: var(--vip-brand);
  background: rgba(0, 87, 164, 0.05);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  overflow: hidden;
  border-radius: 12px;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.locked-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   ESTILOS DEL BOTÓN FLOTANTE DE WHATSAPP
   ========================================================================== */
.btn-whatsapp {
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: #25d366; /* Color oficial de la marca WhatsApp */
  color: #ffffff !important; /* Forzamos blanco sobre el verde */
  border-radius: 50%;
  font-size: 2rem;
  z-index: 1020; /* Nivel estratégico: Por encima del contenido (1000) pero debajo de modales (1050) y menús superiores (1040) */
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Efecto rebote suave */

  /* Animación de pulso para llamar la atención del usuario */
  animation: pulse-whatsapp 2s infinite;
}

/* Efecto al pasar el cursor (Escritorio) */
.btn-whatsapp:hover {
  background-color: #128c7e;
  transform: scale(1.15) translateY(-5px);
  color: #ffffff;
  animation: none; /* Pausar el pulso al hacer hover */
}

/* Definición de la animación de pulso */
@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ==========================================================================
   AJUSTES ESPECÍFICOS PARA MÓVILES (Evita tapar contenido y menús)
   ========================================================================== */
@media (max-width: 768px) {
  .btn-whatsapp {
    /* En tu diseño, el menú móvil está en bottom: 20px. 
           Subimos el botón a 90px para que quede levitando justo arriba del menú sin taparlo */
    bottom: 95px;
    right: 15px;

    /* Reducimos ligeramente el tamaño para que no robe tanto espacio visual en pantallas pequeñas */
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
  }
}
