/* ========================================
   AulaVirtualVR v2 Override CSS
   Paleta: Primario #0D4A7C, Acento #E74C3C, Neutro #2C3E50, Fondo #F8F9FA
   Tipografía: Open Sans
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap');

/* Root & Typography */
#v2-root,
#v2-root *:not([class^="icon-"]):not([class*=" icon-"]) {
  font-family: 'Open Sans', sans-serif;
}

/* Restaurar FontAwesome para íconos dentro de v2-root */
#v2-root [class^="icon-"],
#v2-root [class*=" icon-"] {
  font-family: FontAwesome !important;
}

/* Eliminar gap entre header sticky y el banner (BS3 .navbar tiene margin-bottom:20px) */
#v2-root .hero-area {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#v2-root .navbar {
  margin-bottom: 0 !important;
}

/* AOS: elementos visibles por defecto antes de que el JS los anime */
#v2-root [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
#v2-root [data-aos].aos-animate {
  opacity: 1 !important;
  transform: none !important;
}

/* Reset body margin/padding para v2 */
body:has(#v2-root) {
  margin: 0 !important;
  padding: 0 !important;
  padding-top: 0 !important;
}

#v2-root body {
  color: #2C3E50;
  background-color: #F8F9FA;
}

/* Color Overrides - Primary Backgrounds */
.dark_2_bg {
  background-color: #0D4A7C !important;
}

.dark_2_bg a,
.dark_2_bg p,
.dark_2_bg span,
.dark_2_bg li {
  color: #fff;
}

.dark_2_bg a:hover {
  color: #E74C3C;
}

/* Color Overrides - Secondary/Light Backgrounds */
.semi_dark_bg,
.dark_3_bg,
.bg_dark_9 {
  background-color: #F8F9FA !important;
}

.semi_black_bg {
  background-color: rgba(13, 74, 124, 0.65) !important;
}

/* Button Styles */
.button_two,
.button_two_plane {
  background-color: #E74C3C;
  border: 2px solid #E74C3C;
  color: #fff;
  padding: 12px 28px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.3s ease;
  text-transform: none;
  font-family: 'Open Sans', sans-serif;
}

.button_two:hover,
.button_two_plane:hover {
  background-color: #c93c2a;
  border-color: #c93c2a;
}

.button_one {
  background-color: #E74C3C !important;
  border-color: #E74C3C !important;
}

.button_one:hover {
  background-color: #c93c2a !important;
  border-color: #c93c2a !important;
}

/* Primary Button (Bootstrap override) */
.btn-primary {
  background-color: #0D4A7C;
  border-color: #0D4A7C;
}

.btn-primary:hover,
.btn-primary:active {
  background-color: #092d4c;
  border-color: #092d4c;
}

.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 74, 124, 0.25);
}

/* Section Titles */
#v2-root .section-title h2,
#v2-root .section-title-2 h2,
#v2-root .sub-title,
#v2-root h1,
#v2-root h2,
#v2-root h3 {
  color: #0D4A7C;
  font-weight: 600;
}

#v2-root .section-title p {
  color: #2C3E50;
  font-weight: 400;
}

/* Hero Section */
#v2-root .slider-content-2 h2 {
  color: #fff;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.2;
}

#v2-root .slider-content-2 p {
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
}

/* Course Cards */
#v2-root .single-featured-3 {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: box-shadow 0.3s ease;
}

#v2-root .single-featured-3:hover {
  box-shadow: 0 8px 24px rgba(13, 74, 124, 0.12);
}

#v2-root .featured-text-and-info h3 a {
  color: #0D4A7C;
  font-weight: 600;
  transition: color 0.3s ease;
}

#v2-root .featured-text-and-info h3 a:hover {
  color: #E74C3C;
}

#v2-root .product-price-3 {
  background-color: #E74C3C;
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
}

/* Service Cards */
#v2-root .single-service-4 {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.3s ease;
}

#v2-root .single-service-4:hover {
  box-shadow: 0 8px 24px rgba(13, 74, 124, 0.12);
  transform: translateY(-4px);
}

#v2-root .single-service-4 h4 {
  color: #0D4A7C;
  font-weight: 600;
}

/* Truncar presentación de curso a 3 líneas */
#v2-root .course-presentacion {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  /*max-height: 4.5em;*/
}

#v2-root .single-service-4 p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Neutraliza el clearfix BS3 que rompe el navbar BS5 en mobile/tablet */
@media (max-width: 991.98px) {
  #v2-root > header > nav > .container::before,
  #v2-root > header > nav > .container::after,
  #v2-root > header .navbar::before,
  #v2-root > header .navbar::after,
  #v2-root > header .navbar-collapse::before,
  #v2-root > header .navbar-collapse::after {
    content: none !important;
    display: none !important;
  }

  /* BS3 fuerza .navbar-collapse.collapse { display:block !important } desde 768px,
     lo que impide que BS5 lo colapse en tablets (768-991px). Se revierte aquí. */
  #v2-root > header .navbar-collapse.collapse:not(.show) {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  #v2-root > header .navbar-collapse.collapse.show,
  #v2-root > header .navbar-collapse.collapsing {
    display: block !important;
  }
}

/* Half Column Section (Sobre Ediciones VR) */
#v2-root .half-column-content {
  background-color: #F0F4F8;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#v2-root .half-column-content h2 {
  color: #0D4A7C;
}

#v2-root .half-column-content p {
  color: #2C3E50;
  line-height: 1.8;
  font-weight: 300;
}

#v2-root .half-column-content a {
  color: #E74C3C;
  font-weight: 500;
  transition: color 0.3s ease;
}

#v2-root .half-column-content a:hover {
  color: #0D4A7C;
}

/* Countdown Stats */
#v2-root .single-countdown-5 {
  text-align: center;
  padding: 20px 0;
  border-bottom: 2px solid #E74C3C;
}

#v2-root .single-countdown-5 span.counter {
  font-size: 2.5rem;
  font-weight: 700;
  color: #0D4A7C;
  display: block;
}

#v2-root .single-countdown-5 p {
  color: #2C3E50;
  font-weight: 500;
  margin-top: 8px;
}

/* Team Cards */
#v2-root .single-team {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

#v2-root .single-team:hover {
  box-shadow: 0 8px 24px rgba(13, 74, 124, 0.12);
}

#v2-root .member-info-3 h5 {
  color: #0D4A7C;
  font-weight: 600;
}

#v2-root .member-info-3 span {
  color: #E74C3C;
  font-size: 13px;
}

/* Link Styles */
#v2-root a {
  color: #0D4A7C;
  transition: color 0.3s ease;
}

#v2-root a:hover {
  color: #E74C3C;
  text-decoration: none;
}

/* Form Elements */
#v2-root .form-control {
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  padding: 12px 16px;
  font-family: 'Open Sans', sans-serif;
  color: #2C3E50;
}

#v2-root .form-control:focus {
  border-color: #0D4A7C;
  box-shadow: 0 0 0 0.2rem rgba(13, 74, 124, 0.25);
}

#v2-root .form-control::placeholder {
  color: #999;
}

/* Footer */
#v2-root footer {
  background-color: #0D4A7C;
}

#v2-root .footer-area {
  background-color: #0D4A7C !important;
}

#v2-root footer p,
#v2-root footer span {
  color: #ccc;
}

#v2-root footer h3 {
  color: #fff;
  font-weight: 600;
  margin-bottom: 16px;
}

#v2-root footer a {
  color: #ccc;
}

#v2-root footer a:hover {
  color: #E74C3C;
}

#v2-root .footer-bottom-wrapper {
  border-top-color: rgba(255, 255, 255, 0.2) !important;
}

#v2-root .copyright-text p {
  color: #ccc;
}

/* Contact Form (Full Width Section) */
#v2-root .contact-form-wrapper h2 {
  color: #fff;
  margin-bottom: 24px;
}

#v2-root .contact-form-wrapper .button_two {
  width: 100%;
  margin-top: 16px;
}

/* Text Colors */
#v2-root .text-white {
  color: #fff !important;
}

#v2-root .text-dark {
  color: #0D4A7C !important;
}

/* Badge / Labels */
#v2-root .badge-primary {
  background-color: #0D4A7C;
}

#v2-root .badge-danger {
  background-color: #E74C3C;
}

/* Borders & Separators */
#v2-root .border-top {
  border-top-color: #e0e0e0 !important;
}

#v2-root .border {
  border-color: #e0e0e0 !important;
}

/* Accessibility - Contrast Check */
/* Primary text on primary bg: #0D4A7C on #fff = ratio ~7.5:1 (WCAG AA Pass) */
/* White text on primary bg: #fff on #0D4A7C = ratio ~9.5:1 (WCAG AAA Pass) */
/* Accent text on white: #E74C3C on #fff = ratio ~4.7:1 (WCAG AA Pass) */

/* Responsive adjustments */
@media (max-width: 768px) {
  #v2-root .half-column-content {
    padding: 40px 10px;
  }

  #v2-root .half-column-content > div {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-top: 10px !important;
  }

  #v2-root .slider-content-2 h2 {
    font-size: 2rem;
  }

  #v2-root .section-ptb {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

@media (max-width: 576px) {
  #v2-root .slider-content-2 h2 {
    font-size: 1.5rem;
  }

  #v2-root .button_two,
  #v2-root .button_two_plane {
    padding: 10px 20px;
    font-size: 14px;
  }

  #v2-root .section-ptb {
    padding-top: 50px;
    padding-bottom: 50px;
  }
}

/* Banner de secciones de curso */
#v2-root .course-section-banner {
  height: 160px;
  overflow: hidden;
}
#v2-root .course-section-banner img,
#v2-root .course-section-banner picture img {
  width: 100%;
  height: 160px;
  object-fit: fill;
  object-position: top;
  display: block;
}
@media (max-width: 767px) {
  #v2-root .course-section-banner,
  #v2-root .course-section-banner img,
  #v2-root .course-section-banner picture img {
    height: 90px;
  }
}

/* ========================================
   Popups / FancyBox — Estilo de marca V2
   Paleta: Primario #0D4A7C, Acento #E74C3C
   Los popups se renderizan fuera de #v2-root
   en .fancybox-inner, así que el scope es global
   ======================================== */

/* Tipografía base del popup */
.fancybox-inner {
  font-family: 'Open Sans', sans-serif;
  color: #2C3E50;
}

/* Overlay oscuro más alineado a la paleta */
.fancybox-overlay {
  background: rgba(13, 74, 124, 0.55);
}

/* Skin del contenedor fancybox: borde sutil */
.fancybox-skin {
  border-radius: 8px !important;
  box-shadow: 0 12px 40px rgba(13, 74, 124, 0.20) !important;
}

/* Panel heading — encabezado del popup */
.fancybox-inner .panel-heading {
  background-color: #0D4A7C !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

/* Panel body */
.fancybox-inner .panel-body {
  padding: 20px 24px 24px !important;
  background: #fff !important;
}

/* Eliminar margen inferior del panel */
.fancybox-inner .panel {
  margin-bottom: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Notas / ayuda dentro del popup */
.fancybox-inner .bs-note {
  background: #EBF3FB;
  color: #0D4A7C;
  border-left: 3px solid #0D4A7C;
  padding: 8px 12px !important;
  border-radius: 0 4px 4px 0;
  font-size: 13px !important;
  margin-bottom: 16px !important;
}

/* Labels de formulario */
.fancybox-inner label {
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #2C3E50 !important;
  margin-bottom: 4px !important;
}

/* Inputs */
.fancybox-inner .form-control {
  border: 1px solid #d0d0d0 !important;
  border-radius: 4px !important;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-family: 'Open Sans', sans-serif !important;
  color: #2C3E50 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fancybox-inner .form-control:focus {
  border-color: #0D4A7C !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 74, 124, 0.18) !important;
  outline: none !important;
}

/* Botones de acción en popups — todos en rojo acento */
.fancybox-inner .btn-primary {
  background-color: #E74C3C !important;
  border-color: #E74C3C !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 9px 22px !important;
  border-radius: 4px !important;
  transition: background 0.2s ease !important;
}

.fancybox-inner .btn-primary:hover,
.fancybox-inner .btn-primary:focus {
  background-color: #c93c2a !important;
  border-color: #c93c2a !important;
}

/* Botón success (Enviar Inscripción) */
.fancybox-inner .btn-success {
  background-color: #E74C3C !important;
  border-color: #E74C3C !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 9px 22px !important;
  border-radius: 4px !important;
  transition: background 0.2s ease !important;
}

.fancybox-inner .btn-success:hover,
.fancybox-inner .btn-success:focus {
  background-color: #c93c2a !important;
  border-color: #c93c2a !important;
}

/* Botón cerrar del fancybox — reemplaza el sprite con × CSS puro */
.fancybox-close {
  background-image: none !important;
  background-color: #E74C3C !important;
  border-radius: 50% !important;
  width: 30px !important;
  height: 30px !important;
  top: 8px !important;
  right: 8px !important;
  opacity: 1 !important;
  transition: background 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none;
  z-index: 9999 !important;
  position: absolute !important;
}

.fancybox-close::after {
  content: '×';
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-family: 'Open Sans', sans-serif;
  font-weight: 300;
}

.fancybox-close:hover {
  background-color: #c93c2a !important;
}

/* El panel-heading tiene padding-right suficiente para que el × no tape el título */
.fancybox-inner .panel-heading {
  padding-right: 44px !important;
}

/* Links dentro de popup (ej. "Olvidaste tu contraseña") */
.fancybox-inner a:not(.btn) {
  color: #E74C3C !important;
  text-decoration: none !important;
}

.fancybox-inner a:not(.btn):hover {
  color: #0D4A7C !important;
  text-decoration: underline !important;
}

/* Radio buttons inline */
.fancybox-inner .radio-label {
  font-size: 13px;
  margin-right: 12px;
  vertical-align: middle;
  color: #2C3E50;
}

/* Contenedor de error en inscripción */
.fancybox-inner #error_container {
  color: #E74C3C;
  font-size: 13px;
  padding: 6px 0;
}

/* ========================================
   MOBILE — Popup como drawer lateral derecho
   Solo afecta pantallas ≤ 767px
   ======================================== */
@media (max-width: 767px) {
  /* Overlay: cubre toda la pantalla */
  .fancybox-overlay {
    overflow: hidden !important;
  }

  /* Wrap: ocupa el alto completo, anclado a la derecha */
  .fancybox-wrap {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 88vw !important;
    max-width: 360px !important;
    height: 100% !important;
    margin: 0 !important;
    z-index: 9010 !important;
  }

  /* Skin y outer: forzar 100% del wrap (FancyBox inyecta width inline) */
  .fancybox-skin,
  .fancybox-outer {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
  }

  .fancybox-skin {
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Inner: scroll vertical, ancho 100% del skin (FancyBox inyecta width inline) */
  .fancybox-inner {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  /* Panel y body: columna flex para que el scroll funcione */
  .fancybox-inner .panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
  }

  .fancybox-inner .panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Todos los elementos del panel respetan el ancho */
  .fancybox-inner .panel-heading,
  .fancybox-inner .panel-body,
  .fancybox-inner .form-group,
  .fancybox-inner .bs-note,
  .fancybox-inner .form-control {
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* Botón cerrar: encima del panel-heading */
  .fancybox-close {
    top: 8px !important;
    right: 8px !important;
    z-index: 9020 !important;
  }

  /* Botones de acción: ancho completo */
  .fancybox-inner .btn-primary,
  .fancybox-inner .btn-success {
    width: 100% !important;
    text-align: center !important;
    float: none !important;
    margin-top: 8px !important;
    box-sizing: border-box !important;
  }
}

/* ========================================
   MOBILE — Botones de navegación de módulos
   en una sola línea (Módulo anterior / siguiente)
   ======================================== */
@media (max-width: 575px) {
  /* El nav de paginación ya tiene flex; aseguramos que no se rompa */
  [data-testid="course-view-pager"] {
    gap: 6px !important;
  }

  [data-testid="course-view-pager"] #link-anterior,
  [data-testid="course-view-pager"] #link-siguiente {
    padding: 9px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
}

/* Imágenes dentro del contenido del módulo: nunca exceder el ancho del contenedor */
#modulo-container img {
  max-width: 100% !important;
  /*height: auto !important;*/
}

/* Tablas del contenido del módulo — responsive */
#modulo-container table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  border-collapse: collapse;
}

#modulo-container td,
#modulo-container th {
  white-space: normal !important;
  word-break: break-word;
  vertical-align: top;
}

/* Mobile: apilar columnas de tablas de layout (imagen + texto, callouts) */
@media (max-width: 600px) {
  /* Tablas sin borde usadas como layout */
  #modulo-container table[border="0"] td,
  #modulo-container table:not([border]) td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Ocultar celdas-espaciador (solo contienen &nbsp;, width ~10px) */
  #modulo-container table[border="0"] td[style*="width: 10px"],
  #modulo-container table[border="0"] td[style*="width:10px"] {
    display: none !important;
  }

  /* Imágenes en celdas: centradas */
  #modulo-container td img {
    display: block;
    margin: 0 auto 8px;
    max-width: 100% !important;
    /*height: auto !important;*/
  }

  /* Tablas con border="1" (datos tabulares): scroll horizontal */
  #modulo-container table[border="1"] {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* Módulo activo y hover en sidebar del player V2 */
#v2-root .curso-modulos.list-group .list-group-item.active,
#v2-root .curso-modulos.list-group .list-group-item:hover,
#v2-root .curso-modulos.list-group .list-group-item:focus {
  background-color: rgba(231, 76, 60, 0.12) !important;
}
#v2-root .curso-modulos.list-group .list-group-item.active a,
#v2-root .curso-modulos.list-group .list-group-item:hover a,
#v2-root .curso-modulos.list-group .list-group-item:focus a {
  color: #0D4A7C !important;
  text-decoration: none !important;
}
