/* =========================================================
   ATTEMPT / TEST INTERFACE — attempt.css
   ========================================================= */

.attempt-page { background: var(--gray-100); }

.attempt-page .container {
  max-width: 820px;
  background: #fff;
  padding: 28px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

/* ===== PROGRESS ===== */

.attempt-page .progress-track {
  height: 6px;
  background: var(--gray-200);
  border-radius: 99px;
  margin-bottom: 24px;
  overflow: hidden;
}

.attempt-page .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.attempt-page .q-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* ===== QUESTION ===== */

.attempt-page .question {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
}

.attempt-page .q-label {
  font-size: 18px;
  font-weight: 700;
  min-width: 42px;
}

.attempt-page .q-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
}

.attempt-page .match-type {
  white-space: pre-wrap;
  font-family: monospace;
}

.attempt-page .match-layout {
  display: block !important;
}

.attempt-page .match-layout .q-text {
  white-space: pre-wrap;
  font-family: inherit;
}

/* ===== OPTIONS ===== */

.attempt-page .option {
  border: 2px solid var(--gray-200);
  padding: 14px 18px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 15px;
  color: var(--gray-700);
  font-weight: 500;

  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;

  transition: border-color var(--ease),
              background var(--ease),
              box-shadow var(--ease);
}

/* Native radio alignment */
.attempt-page .option input[type="radio"] {
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
  display: inline-block;
}

/* Bubble (A/B/C/D) */
.attempt-page .option-letter {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gray-100);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);

  order: 0;
  margin-right: 6px;
}

/* Option text */
.attempt-page .option-text {
  order: 1;
  flex: 1;
}

/* Hover */
.attempt-page .option:hover {
  border-color: var(--primary-xlight);
  background: var(--primary-light);
}

.attempt-page .option:hover .option-letter {
  background: var(--primary-xlight);
  color: var(--primary);
}

/* Selected */
.attempt-page .option.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.attempt-page .option.selected .option-letter {
  background: var(--primary);
  color: #fff;
}

/* Correct / Wrong */
.attempt-page .option.correct {
  background: var(--success-light);
  border-color: var(--success);
}

.attempt-page .option.correct .option-letter {
  background: var(--success);
  color: #fff;
}

.attempt-page .option.wrong {
  background: var(--danger-light);
  border-color: var(--danger);
}

.attempt-page .option.wrong .option-letter {
  background: var(--danger);
  color: #fff;
}

/* ===== NAVIGATION ===== */

.attempt-page .nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--gray-100);
}

/* ===== STICKY TIMER ===== */

#floatingTimer {
  position: sticky;
  top: 64px;
  z-index: 150;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 15px;

  border-bottom: 3px solid var(--primary);
}

#topSubmitBtn {
  position: sticky;
  top: 74px;
  z-index: 151;
  float: right;
  margin-top: -48px;
  margin-right: 16px;
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#topSubmitBtn:hover {
  opacity: 0.9;
}

#floatingTimer .timer-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #60a5fa;
}

#floatingTimer.warning .timer-val { color: #fbbf24; }

#floatingTimer.critical .timer-val {
  color: #f87171;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== MOBILE OPTIMIZATION ===== */

@media (max-width: 600px) {

  .attempt-page .container {
    padding: 16px 12px;
    border-radius: var(--r-lg);
  }

  .attempt-page .option {
    font-size: 16px;
    padding: 14px 16px;
    gap: 12px;
  }

  .attempt-page .option-letter {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  #floatingTimer {
    font-size: 16px;
    padding: 10px 14px;
  }

  #floatingTimer .timer-val {
    font-size: 20px;
  }

  /* Keep navigation reachable above bottom nav */
  .attempt-page .nav {
    position: sticky;
    bottom: 64px;
    background: #fff;
    padding: 10px 0 4px;
    margin-top: 18px;
  }
}

.loading-message {
  position: fixed;
  inset: 0;
  background: #000;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 40px;

  font-size: 26px;
  font-weight: 700;
  line-height: 1.6;

  font-family: "Poppins", "Segoe UI", sans-serif;

  color: #ffffff;

  z-index: 9999;
}