/* ==========================================================
   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: #0d4f8c !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
  transition: transform 0.15s !important;
}
.pill-btn:not(:disabled):active .pill-icon {
  transform: scale(0.93) !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;
}
/* ══════════════════════════════════════════
   PILL-NAV — PROGRESO DE MÓDULO INTEGRADO
   ══════════════════════════════════════════ */

.pill-divider {
  width: 44px !important;
  height: 1.5px !important;
  background: rgba(255,255,255,0.2) !important;
  margin: 5px 0 !important;
  border-radius: 99px !important;
  flex-shrink: 0 !important;
}

/* ── Anillo de progreso ── */
.pill-progress-widget {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 8px 0 4px !important;
  cursor: default !important;
  width: 100% !important;
}

.pill-ring-wrap {
  position: relative !important;
  width: 62px !important;
  height: 62px !important;
}

.pill-progress-ring {
  width: 62px !important;
  height: 62px !important;
  flex-shrink: 0 !important;
}

.pill-ring-fill {
  transition: stroke-dashoffset 0.6s cubic-bezier(.4,0,.2,1) !important;
}

.pill-ring-center {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.pill-ring-pct {
  font-size: 14px !important;
  font-weight: 900 !important;
  color: #fff !important;
  line-height: 1 !important;
  letter-spacing: -0.5px !important;
  font-family: 'Nunito', sans-serif !important;
}

.pill-ring-sub {
  font-size: 6.5px !important;
  font-weight: 700 !important;
  color: rgba(255,255,255,0.5) !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  margin-top: 2px !important;
  font-family: 'Nunito', sans-serif !important;
}

.pill-progress-module-label {
  font-size: 9px !important;
  font-weight: 800 !important;
  color: rgba(255,255,255,0.7) !important;
  letter-spacing: 0.04em !important;
  font-family: 'Nunito', sans-serif !important;
}

/* ── Contador de módulo ── */
.pill-counter {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 6px 0 10px !important;
  cursor: default !important;
  width: 100% !important;
}

.pill-counter-num {
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #fff !important;
  line-height: 1 !important;
  letter-spacing: -0.5px !important;
  font-family: 'Nunito', sans-serif !important;
}

.pill-counter-of {
  font-size: 8px !important;
  font-weight: 700 !important;
  color: rgba(255,255,255,0.55) !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  font-family: 'Nunito', sans-serif !important;
}

.pill-counter-segs {
  display: flex !important;
  gap: 3px !important;
  margin-top: 3px !important;
  width: 52px !important;
}

.pill-counter-seg {
  flex: 1 !important;
  height: 3px !important;
  border-radius: 99px !important;
  background: rgba(255,255,255,0.18) !important;
  transition: background 0.3s !important;
}

.pill-counter-seg.done {
  background: rgba(255,255,255,0.55) !important;
}

.pill-counter-seg.active {
  background: #fff !important;
}

/* ── Responsive móvil ── */
@media (max-width: 767px) {
  .pill-progress-widget { flex-direction: row !important; padding: 6px 10px !important; gap: 8px !important; }
  .pill-ring-wrap { width: 52px !important; height: 52px !important; }
  .pill-progress-ring { width: 52px !important; height: 52px !important; }
  .pill-ring-pct { font-size: 13px !important; }
  .pill-divider { width: 1px !important; height: 30px !important; margin: 0 4px !important; }
  .pill-counter { flex-direction: row !important; gap: 6px !important; padding: 6px 8px !important; }
  .pill-counter-segs { display: none !important; }
}

@media (max-width: 575px) {
  .pill-ring-wrap { width: 44px !important; height: 44px !important; }
  .pill-progress-ring { width: 44px !important; height: 44px !important; }
  .pill-ring-pct { font-size: 11px !important; }
  .pill-progress-module-label { display: none !important; }
}