/* =========================================================================
   APPI Mock Test — Custom Styles
   Mobile-first approach. Base styles are for mobile; enhance with Tailwind
   responsive prefixes (sm:, md:, lg:) in HTML.
   ========================================================================= */

/* Base body — mobile-first: larger base for readability on small screens */
body {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scale down slightly on larger screens where space is less constrained */
@media (min-width: 768px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }
}

/* ---- Mobile Typography Boost ---- */
/* Ensure readable sizes for key UI elements on small screens */
@media (max-width: 639px) {
  h1 { font-size: 1.75rem !important; }
  h2 { font-size: 1.35rem !important; }
  h3 { font-size: 1.15rem !important; }

  /* Form labels and options */
  .level-radio span,
  .subject-checkbox span {
    font-size: 1rem;
  }

  /* Answer options during test */
  .answer-option label,
  .answer-option span {
    font-size: 1rem;
  }

  /* Question text */
  #question-container p {
    font-size: 1.05rem;
    line-height: 1.6;
  }

  /* Results review cards */
  #review-list p {
    font-size: 0.95rem;
  }

  /* Timer and progress */
  #timer-display {
    font-size: 1.1rem;
  }

  /* Buttons */
  button, .btn {
    font-size: 1rem;
  }
}

/* ---- Progress Bar ---- */
.progress-bar-track {
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.dark .progress-bar-track {
  background-color: #3d3d3d;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
  background-color: #4285F4;
}

/* ---- Timer Pulse ---- */
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.timer-warning {
  animation: timerPulse 1s ease-in-out infinite;
  color: #EA4335;
}

/* ---- Question Card Transition ---- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-enter {
  animation: slideInRight 0.3s ease-out;
}

/* ---- Radio/Checkbox Custom Styling ---- */
.answer-option {
  min-height: 48px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.answer-option:active {
  transform: scale(0.98);
}

.answer-option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #4285F4;
  flex-shrink: 0;
}

/* Subject checkbox styling */
.subject-checkbox {
  min-height: 44px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.subject-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4285F4;
  flex-shrink: 0;
}

/* Level radio styling */
.level-radio {
  min-height: 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.level-radio input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: #4285F4;
  flex-shrink: 0;
}

/* ---- Report Card ---- */
@keyframes scoreReveal {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.score-reveal {
  animation: scoreReveal 0.5s ease-out;
}

/* ---- Ad Container ---- */
.ad-container {
  text-align: center;
  overflow: hidden;
}

/* ---- Cookie Consent Slide-in ---- */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner-enter {
  animation: slideUp 0.3s ease-out;
}

/* ---- FAQ Accordion ---- */
details summary {
  cursor: pointer;
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  font-weight: bold;
  color: #4285F4;
  flex-shrink: 0;
}

details[open] summary::before {
  content: '−';
}

/* ---- Scrollbar Styling (Dark Mode) ---- */
.dark ::-webkit-scrollbar {
  width: 8px;
}

.dark ::-webkit-scrollbar-track {
  background: #1e1e1e;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3d3d3d;
  border-radius: 4px;
}

/* ---- Focus Visible (Accessibility) ---- */
:focus-visible {
  outline: 2px solid #4285F4;
  outline-offset: 2px;
}

/* ---- Selection Color ---- */
::selection {
  background-color: #4285F4;
  color: white;
}

/* ---- Responsive Table ---- */
.responsive-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
