* {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}

:root {
  --text-main: #132438;
  --bg-gradient: linear-gradient(180deg, #e3f5fb 0%, #ebfaf2 50%, #eff9fd 100%);
  --card-bg: rgba(255, 255, 255, 0.78);
  --blue-primary: #1982f6;
  --correct-green-bg: #dff8e8;
  --correct-green-border: #2ecc71;
  --wrong-red-bg: #ffebee;
  --wrong-red-border: #ff4d5a;
  --shadow-card: 0 10px 30px rgba(60, 110, 140, 0.08);
}

body {
  min-height: 100vh;
  background: var(--bg-gradient) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.quiz-app {
  width: 100%;
  max-width: 500px;
  padding: 10px 16px 40px;
}

/* =====================================================
   TOP CIRCULAR PROFILE AVATAR
===================================================== */
.top-profile-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 10px;
  width: 100%;
}

.top-profile-img {
  width: 68px;
  height: 68px;
  border-radius: 50% !important;
  object-fit: cover;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(11, 34, 64, 0.16);
  display: block;
}

/* =====================================================
   HEADER: SOLID BLACK PILL WITH ABSOLUTE CENTER TITLE
===================================================== */
.quiz-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 74px;
  margin: 6px 0 18px;
  background: #000000 !important;
  border-radius: 28px !important;
  padding: 10px 18px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

/* White Back Button with Dark Icon */
.back-button {
  display: none !important;
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  border: none !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  color: #0b2240 !important;
  place-items: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  z-index: 3 !important;
  transition: transform 0.15s ease !important;
}

.back-button.visible {
  display: grid !important;
}

.back-button:active {
  transform: translateY(-50%) scale(0.95) !important;
}

/* Left Elements: Green Dot + White Cap Box */
.brand-left-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: absolute !important;
  left: 64px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 2 !important;
}

.quiz-header:not(.has-back) .brand-left-group {
  left: 20px !important;
}

/* =====================================================
   SHARP SOLID WHITE DOT (ULTRA-BRIGHT WHEN SMALL)
===================================================== */
.brand-dot {
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  background-color: #00ff00;
  animation: sharpPulse 1.8s ease-in-out infinite !important;
  flex-shrink: 0 !important;
}

@keyframes sharpPulse {
  0%, 100% {
    transform: scale(0.6);
    background-color: #ffffff !important;
    filter: drop-shadow(0 0 4px #ffffff) drop-shadow(0 0 8px #00ff00) !important;
    opacity: 1 !important;
  }
  50% {
    transform: scale(1.25);
    background-color: #00FF00 !important;
    filter: none !important;
    opacity: 0.9 !important;
  }
}


/* White Frame For Cap */
.cap-frame {
  width: 34px !important;
  height: 34px !important;
  background: #ffffff !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

.brand-cap {
  font-size: 20px !important;
  line-height: 1 !important;
}

/* ABSOLUTE MATHEMATICAL CENTER TITLE */
.brand-content {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  text-align: center !important;
  width: max-content !important;
  z-index: 2 !important;
}

.brand-content h1 {
  font-size: 21px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: -0.5px !important;
  line-height: 1.15 !important;
}

.brand-content p {
  font-size: 10.5px !important;
  color: #ffffff !important;
  margin-top: 1px !important;
  white-space: nowrap !important;
}

/* MATCHING WHITE TIMER CONTAINER */
.timer-box {
  display: none !important;
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: #ffffff !important;
  padding: 8px 12px !important;
  border-radius: 14px !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  z-index: 3 !important;
}

.timer-box.timer-visible {
  display: block !important;
}

.timer-box span {
  font-family: "Courier New", monospace !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0b2240 !important;
  letter-spacing: 0.5px;
}

/* =====================================================
   PROGRESS BAR CAPSULES (DYNAMIC 10 LIMIT)
===================================================== */
.progress-section {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 16px !important;
  width: 100% !important;
}

.progress-number {
  font-weight: 800 !important;
  font-size: 14px !important;
  color: #1a2f44 !important;
  white-space: nowrap !important;
}

.segmented-progress {
  flex: 1 1 auto !important;
  min-width: 100px !important;
}

#capsules-container {
  display: flex !important;
  gap: 4px !important;
  align-items: center !important;
  width: 100% !important;
}

.progress-capsule {
  flex: 1 1 0 !important;
  height: 12px !important;
  background: #d8e5ee !important;
  border-radius: 6px !important;
  transition: background 0.3s ease !important;
}

.progress-capsule.filled {
  background: linear-gradient(90deg, #82edd0, #4dc5f7) !important;
}

.stats-indicators {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.stat-badge {
  font-weight: 700 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

/* =====================================================
   QUESTION CARDS & SELECTIONS
===================================================== */
.question-card {
  background: var(--card-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 26px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  padding: 22px 18px !important;
  box-shadow: var(--shadow-card) !important;
}

.question-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-primary);
  margin-bottom: 4px;
}

.selection-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0d2138;
}

.selection-description {
  margin-top: 4px;
  margin-bottom: 18px;
  font-size: 14px;
  color: #556c82;
}

.subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcedfd;
  color: #37536f;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.quiz-question-card h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  color: #0d2138;
  margin-bottom: 18px;
}

/* =====================================================
   OPTIONS & SELECTION BUTTONS
===================================================== */
.options-container, .set-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 11px !important;
  margin-bottom: 16px !important;
}

.option-button {
  width: 100% !important;
  min-height: 54px !important;
  background: #ffffff !important;
  border: 1.5px solid #e1e9f0 !important;
  border-radius: 18px !important;
  padding: 10px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

.option-letter {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px !important;
  background: #eef5fb !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #1a385c !important;
  margin: 0 !important;
}

.option-text {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #172e45 !important;
  text-align: left !important;
  margin: 0 !important;
  flex: 0 1 auto !important;
}

.option-button.correct {
  background: var(--correct-green-bg) !important;
  border-color: var(--correct-green-border) !important;
}

.option-button.correct::after {
  content: "✔";
  margin-left: auto !important;
  width: 24px;
  height: 24px;
  background: #17b95b;
  color: #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: bold;
}

.option-button.wrong {
  background: var(--wrong-red-bg) !important;
  border-color: var(--wrong-red-border) !important;
}

.option-button.wrong .option-letter {
  background: #ff4d5a !important;
  color: #ffffff !important;
}

/* =====================================================
   EXPLANATION DRAWER
===================================================== */
.explanation-bar {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(90deg, #1886f7, #9b41ee);
  border-radius: 18px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.explanation-card {
  background: rgba(239, 248, 255, 0.75);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid #dcebf7;
  margin-bottom: 18px;
}

.explanation-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #10263f;
}

.explanation-text {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: #273b4e;
}

/* =====================================================
   ACTIONS & BOTTOM NAVIGATION
===================================================== */
.next-button {
  width: 100%;
  height: 52px;
  background: var(--blue-primary);
  color: white;
  border: none;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(26, 130, 247, 0.35);
  margin-bottom: 12px;
}

.next-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz-bottom {
  display: flex;
  justify-content: flex-end;
}

.previous-button {
  background: #ffffff;
  border: 1px solid #d8e5ee;
  border-radius: 18px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #1e354d;
  cursor: pointer;
}

/* =====================================================
   RESULT SCREEN (SCORES & STATS)
===================================================== */
.result-screen {
  text-align: center;
  padding: 10px 0;
}

.result-icon { font-size: 46px; margin-bottom: 6px; }
.result-title { font-size: 26px; font-weight: 800; color: #0b2240; }
.result-subtitle { color: #5d758d; font-size: 14px; margin: 4px 0 18px; }

.result-table-box {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid #dbe6ef;
}

.score-number { display: block; font-size: 40px; font-weight: 800; color: #0b2240; margin: 4px 0; }
.max-marks-number { display: block; font-size: 32px; font-weight: 800; color: #1982f6; margin: 4px 0; }

.result-grid, .marks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.grid-card, .marks-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid #dbe6ef;
  text-align: center;
}

.card-title { display: block; font-size: 12px; color: #657e96; font-weight: 600; margin-bottom: 6px; }
.grid-card strong, .marks-card strong { font-size: 20px; font-weight: 800; color: #0f2742; }
.correct-card strong, .pos-text { color: #27ae60 !important; }
.wrong-card strong, .neg-text { color: #e74c3c !important; }

.restart-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c9dbe7;
  border-radius: 18px;
  background: #ffffff;
  color: #143559;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.hidden, .hidden-feedback-icon {
  display: none !important;
}

/* =====================================================
   HINT BUTTON & BOX STYLING
===================================================== */
.hint-button {
  width: 100% !important;
  min-height: 46px;
  background: #fffbeb !important;
  border: 1.5px solid #fef3c7 !important;
  border-radius: 18px !important;
  color: #d97706 !important;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin: 10px 0 14px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.hint-button:active {
  transform: scale(0.98);
}

.hint-box {
  background: #ffffff !important;
  border: 1px solid #cde4fe !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 2px 8px rgba(25, 130, 246, 0.08);
}

.hint-box p {
  font-size: 14px;
  color: #1d3557;
  line-height: 1.5;
  margin: 0;
}
