/* ==========================================================
   MAIN.CSS — Layout principal del player ICBF
   Breakpoints:
     📱 Móvil:         < 576px
     📱 Móvil L:       576px – 767px
     💻 Tablet:        768px – 1023px
     🖥️ Desktop:       1024px – 1439px
     🖥️ HD:            ≥ 1440px
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100vw; height: 100vh; overflow: hidden;
  background: var(--bg-app, transparent);
  font-family: 'Nunito', system-ui, sans-serif;
}

.app-shell { position: relative; width: 100vw; height: 100vh; overflow: hidden; }

.app-shell.layout-fullscreen,
.app-shell.layout-fullscreen .main-card,
.app-shell.layout-fullscreen .content-area,
.app-shell.layout-fullscreen .content-render,
.app-shell.layout-fullscreen #app {
  width: 100vw !important; height: 100vh !important;
  overflow: hidden !important; padding: 0 !important; margin: 0 !important;
  position: fixed !important; top: 0 !important; left: 0 !important;
}

/* ── Layout VIDEO ── */
.app-shell.layout-video,
.app-shell.layout-video .main-card,
.app-shell.layout-video .content-area,
.app-shell.layout-video .content-render,
.app-shell.layout-video #app {
  width: 100vw !important; height: 100vh !important;
  overflow: hidden !important; padding: 0 !important; margin: 0 !important;
  position: fixed !important; top: 0 !important; left: 0 !important;
}

/* ── Loading veil ── */
.app-loading-veil {
  position: fixed; inset: 0; background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999; transition: opacity 0.3s;
}
.app-loading-veil.hidden { display: none; }
.app-loading-content { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.app-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--green-light, #e8f5e9);
  border-top-color: var(--green-main, #2e7d32);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   PILL NAV
   ══════════════════════════════════════════ */

/* 🖥️ Desktop — lateral izq */
.pill-nav {
  position: fixed !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  background: var(--amber-main) !important;
  border-radius: 30px 30px 30px 30px !important;
  padding: 18px 10px !important;
  gap: 4px;
}

.pill-btn {
  display: flex !important; flex-direction: column !important;
  align-items: center !important; gap: 4px !important;
  background: transparent !important; border: none !important;
  cursor: pointer !important;
  padding: clamp(6px, 1vh, 10px) 4px !important;
  color: var(--white) !important; transition: opacity 0.2s;
}
.pill-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pill-icon {
  width: clamp(36px, 4vw, 44px) !important;
  height: clamp(36px, 4vw, 44px) !important;
  background: #ffffff !important; border-radius: 50% !important;
  display: flex !important; align-items: center !important;
  justify-content: center !important; color: #050248 !important;
}
.pill-icon svg {
  width: clamp(18px, 2.5vw, 22px) !important;
  height: clamp(18px, 2.5vw, 22px) !important;
  display: block !important;
}
.pill-label {
  font-size: clamp(0.55rem, 1vw, 0.65rem) !important;
  font-weight: 700 !important; color: white !important; text-align: center !important;
}

/* 💻 Tablet landscape (768px – 1023px) */
@media (max-width: 1023px) {
  .pill-nav {
    padding: 14px 8px !important;
    gap: 2px;
  }
}

/* 📱 Tablet portrait + Móvil L (≤ 767px) — barra inferior */
@media (max-width: 767px) {
  .pill-nav {
    left: 0 !important; right: 0 !important;
    top: auto !important; bottom: 0 !important;
    transform: none !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 10px 16px !important;
    width: 100% !important;
  }
  .pill-btn { padding: 6px 8px !important; }
  .pill-icon { width: 38px !important; height: 38px !important; }
  .pill-icon svg { width: 20px !important; height: 20px !important; }
  .pill-label { font-size: 0.6rem !important; }
}

/* 📱 Móvil (< 576px) */
@media (max-width: 575px) {
  .pill-nav { padding: 8px 12px !important; }
  .pill-icon { width: 34px !important; height: 34px !important; }
  .pill-icon svg { width: 18px !important; height: 18px !important; }
  .pill-label { display: none !important; }
}

/* ── Botones ── */
#btn-next:disabled, #btn-next.disabled {
  opacity: 0.5; pointer-events: none; cursor: not-allowed;
}

/* ══════════════════════════════════════════
   BARRA DE PROGRESO DEL MÓDULO — arriba centro
   Estilo: Opción 2 — fondo azul oscuro
   ══════════════════════════════════════════ */
.module-progress-bar {
  position: fixed !important;
  top: 25px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9998 !important;
  background: #0578bd !important;
  border-radius: 0 0 20px 20px !important;
  padding: 14px clamp(20px, 3vw, 32px) !important;
  min-width: clamp(240px, 40vw, 500px) !important;
  display: none !important;
}

.module-progress-bar.visible { display: block !important; }

.module-progress-inner {
  display: flex !important;
  align-items: center !important;
  gap: clamp(10px, 1.5vw, 16px) !important;
}

.module-progress-label {
  font-size: clamp(0.65rem, 1.2vw, 0.78rem) !important;
  font-weight: 800 !important;
  color: #B5D4F4 !important;
  white-space: nowrap !important;
  font-family: 'Nunito', sans-serif !important;
  min-width: 64px !important;
}

.module-progress-track {
  flex: 1 !important;
  height: 10px !important;
  background: rgba(255,255,255,0.15) !important;
  border-radius: 99px !important;
  overflow: hidden !important;
}

.module-progress-fill {
  height: 100% !important;
  background: #378ADD !important;
  border-radius: 99px !important;
  transition: width 0.5s ease !important;
  width: 0% !important;
}

.module-progress-pct {
  font-size: clamp(0.65rem, 1.2vw, 0.78rem) !important;
  font-weight: 800 !important;
  color: #fff !important;
  min-width: 36px !important;
  text-align: right !important;
  font-family: 'Nunito', sans-serif !important;
}

/* 📱 Móvil */
@media (max-width: 575px) {
  .module-progress-bar {
    min-width: 90vw !important;
    padding: 10px 16px !important;
  }
  .module-progress-label { min-width: 48px !important; font-size: 0.6rem !important; }
}

/* ── Page error ── */
.page-error {
  padding: 24px; color: #c00; background: #fff0f0;
  border-radius: 8px; margin: 24px;
}