/*
style.css - Sistema de Estudio y Simulación de la Prueba AVANZO
Estética moderna con azul institucional del MINEDUCYT y verde éxito
*/

:root {
  --mined-blue: #1e3a8a;
  --mined-blue-light: #2563eb;
  --mined-blue-dark: #0f172a;
  --mined-gold: #f59e0b;
  --mined-green: #059669;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior-y: auto;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

/* NAVBAR */
.navbar-mined {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  border-bottom: 3px solid var(--mined-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.navbar-mined .navbar-nav {
  align-items: center;
}

.navbar-mined .navbar-nav .nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  padding-left: 0.4rem !important;
  padding-right: 0.4rem !important;
  white-space: nowrap !important;
  transition: all 0.15s ease;
}

.navbar-mined .navbar-nav .nav-link:hover {
  color: #fbbf24 !important;
}

.navbar-mined .dropdown-menu {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 8px 0;
}

.navbar-mined .dropdown-item {
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.15s ease;
}

.navbar-mined .dropdown-item:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

/* BOTÓN MODERNO DE ACTIVACIÓN $1 Y ESTADO DE LICENCIA */
.nav-cta-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap !important;
}

.btn-activate-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.82rem;
  height: 34px;
  padding: 0 10px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap !important;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1;
}

.btn-activate-modern:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
  color: #ffffff !important;
}

.btn-activate-modern:active {
  transform: translateY(0);
}

.btn-activate-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.88rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-activate-label {
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  white-space: nowrap !important;
}

.btn-activate-price {
  background: #0f172a;
  color: #fbbf24;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  line-height: 1;
  white-space: nowrap !important;
}

/* BOTÓN DE LICENCIA ACTIVA VERIFICADA */
.btn-license-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid #10b981;
  color: #ffffff !important;
  padding: 0 12px;
  border-radius: 50px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap !important;
  flex-shrink: 0;
  font-size: 0.8rem;
  line-height: 1;
}

.btn-license-verified:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

@media (max-width: 1199.98px) {
  .nav-cta-wrapper {
    width: 100%;
    margin-top: 10px !important;
    margin-left: 0 !important;
    justify-content: center;
  }
  .btn-activate-modern,
  .btn-license-verified {
    width: 100%;
    justify-content: center;
    height: 38px;
    font-size: 0.9rem;
  }
}

.brand-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* HERO */
.hero-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #2563eb 100%);
  color: white;
  border-radius: 16px;
  padding: 40px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(30, 58, 138, 0.2);
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
  border-radius: 50%;
}

/* CARDS */
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  transition: all 0.25s ease-in-out;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* EXAM MATRIX NAVIGATION */
.exam-matrix {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.matrix-btn {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-btn:hover {
  background: #e2e8f0;
}

.matrix-btn.active {
  border: 2px solid var(--mined-blue-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.matrix-btn.answered {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.matrix-btn.flagged {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* OPTIONS RADIO BOXES */
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.option-label:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.option-input:checked + .option-label {
  border-color: var(--mined-blue);
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-input:checked + .option-label .option-letter {
  background: var(--mined-blue);
  color: #ffffff;
  border-color: var(--mined-blue);
}

/* FLASHCARDS 3D FLIP */
.flashcard-scene {
  perspective: 1000px;
  width: 100%;
  max-width: 580px;
  height: 320px;
  margin: 0 auto;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: pointer;
}

.flashcard-inner.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flashcard-front {
  background: #ffffff;
}

.flashcard-back {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  transform: rotateY(180deg);
}

/* FOOTER */
.footer-mined {
  background: #0f172a;
  color: #94a3b8;
  border-top: 1px solid #334155;
  font-size: 0.85rem;
}


/* =========================================================
   MODO COMPACTO TODO EN UNA PANTALLA PARA CELULARES
   ========================================================= */
@media (max-width: 768px) {
  .exam-question-card {
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
  }
  .question-text {
    font-size: 0.98rem !important;
    line-height: 1.45 !important;
    margin-bottom: 12px !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  .option-label {
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    touch-action: manipulation;
  }
  .option-letter {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.85rem !important;
  }
  .exam-nav-dock {
    padding: 8px 10px !important;
  }
  /* Optimización de scroll en tablas y modales en teléfonos */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 576px) {
  /* Cuenta regresiva compacta para evitar desborde horizontal */
  #countdown-timer-container {
    gap: 4px !important;
  }
  #countdown-timer-container > div {
    min-width: 54px !important;
    padding: 6px 4px !important;
  }
  #countdown-timer-container .fs-2 {
    font-size: 1.35rem !important;
  }
  #countdown-timer-container .fs-4 {
    font-size: 1rem !important;
  }
  /* Chat flotante adaptativo en pantallas móviles */
  #support-chat-portal {
    bottom: 14px !important;
    right: 14px !important;
    z-index: 1040 !important;
  }
  #support-chat-box {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    height: 72vh !important;
    max-height: 480px !important;
  }
  #support-chat-toggle-btn {
    padding: 6px 12px !important;
  }
}

/* =========================================================
   ESTILOS INSTITUCIONALES DE IMPRESIÓN Y SALTOS DE PÁGINA (PDF)
   ========================================================= */
@page {
  size: letter portrait;
  margin: 12mm 15mm;
}

@media print {
  body {
    background-color: #ffffff !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Ocultar elementos de navegación y botones no deseados */
  .no-print,
  .navbar,
  .navbar-mined,
  .footer-mined,
  .nav-pills,
  .modal,
  .modal-backdrop,
  .btn,
  #filterStudentInput,
  .btn-group,
  .py-1.px-3.text-white.small,
  #switchTeacherModal,
  #videoDocenteModal,
  #teacherKeyModal {
    display: none !important;
  }

  /* Saltos de página limpios */
  .print-page-break,
  .page-break {
    break-before: page !important;
    page-break-before: always !important;
  }

  .print-page-break-after,
  .page-break-after {
    break-after: page !important;
    page-break-after: always !important;
  }

  /* Evitar cortes indeseados en medio de filas y tarjetas */
  .no-break-inside,
  tr,
  .card,
  .feature-card,
  .score-circle,
  .badge-nivel,
  .qr-box,
  .print-avoid-break {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  /* Repetición de encabezados de tabla al saltar de página */
  thead {
    display: table-header-group !important;
  }

  tfoot {
    display: table-footer-group !important;
  }

  /* Eliminar scrollbars y alturas restringidas */
  .table-responsive {
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
  }

  .print-only,
  .print-only-col {
    display: table-cell !important;
  }

  .print-only-block {
    display: block !important;
  }

  .print-signatures {
    display: block !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-top: 35px !important;
  }
}

