/* ===============================
   VARIABLES
================================ */
:root {
  --qb-bg: #ffffff;
  --qb-text: #1e1e1e;
  --qb-muted: #6b7280;
  --qb-border: #e5e7eb;
  --qb-accent: #2563eb;
  --qb-correct: #16a34a;
  --qb-wrong: #dc2626;
}

/* ===============================
   POPUP BASE
================================ */
.qb-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  display: flex;
}

.qb-popup-inner {
  background: var(--qb-bg);
  color: var(--qb-text);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===============================
   TOP BAR (FIXED WITH INNER WRAPPER)
================================ */

/* Outer topbar */
.qb-topbar {
  border-bottom: 1px solid var(--qb-border);
  background: #f9fafb;
}

/* Inner container */
.qb-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  max-width: 850px;
  margin: 0 auto;
}

/* Left & Right groups */
.qb-top-left,
.qb-top-right {
  display: flex;
  gap: 8px;
}

/* Buttons */
.qb-topbar button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--qb-border);
  background: #ffffff;
  color: var(--qb-text);
  cursor: pointer;
}

.qb-topbar button:hover {
  background: #f3f4f6;
}

/* Mobile sticky topbar */
@media (max-width: 768px) {
  .qb-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }
}


/* ===============================
   CONTENT
================================ */
.qb-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

@media (min-width: 1024px) {
  .qb-content {
    width: 850px;
    margin: 0 auto;
  }
}

/* ===============================
   QUESTION
================================ */
.qb-question {
  border: 1px solid var(--qb-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.qb-question h4 {
  font-size: 15px;
  margin-bottom: 10px;
}

/* ===============================
   OPTIONS
================================ */
.qb-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1px solid var(--qb-border);
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 14px;
  color: var(--qb-text);
}

.qb-option:hover {
  border-color: var(--qb-accent);
}

.qb-option.correct {
  border-color: var(--qb-correct);
  background: #ecfdf5;
}

.qb-option.wrong {
  border-color: var(--qb-wrong);
  background: #fef2f2;
}

.qb-exp {
  margin-top: 8px;
  font-size: 13px;
  color: #16a34a;
}

/* ===============================
   BOTTOM NAV (FIXED WITH INNER WRAPPER)
================================ */

/* Outer bottom nav */
.qb-bottom-nav {
  border-top: 1px solid var(--qb-border);
  background: #ffffff;
}

/* Inner container */
.qb-bottom-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  max-width: 850px;
  margin: 0 auto;
}

/* Buttons */
.qb-bottom-nav-inner button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--qb-border);
  background: #ffffff;
  color: var(--qb-text);
  cursor: pointer;
}

.qb-bottom-nav-inner button:disabled {
  background: #c7d2fe;
}

/* Mobile sticky bottom nav */
@media (max-width: 768px) {
  .qb-bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 20;
  }
}

/* ===============================
   FINISH
================================ */
.qb-finish {
  text-align: center;
  margin-top: 40px;
}

.qb-score {
  font-size: 24px;
  font-weight: 600;
  margin: 10px 0;
}

.qb-restart {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--qb-border);
  background: #ffffff;
  color: var(--qb-text);
  cursor: pointer;
}

/* ===============================
   DARK MODE
================================ */
.qb-dark-mode {
  background: #212121;
  color: #ffffff;
}

.qb-dark-mode .qb-topbar {
  background: #181818;
  border-bottom-color: #ffffff0d;
}

.qb-dark-mode .qb-topbar button {
  background: #212121;
  border-color: #ffffff0d;
  color: #ffffff;
}

.qb-dark-mode .qb-question {
  border-color: #ffffff0d;
}

.qb-dark-mode .qb-option {
  background: #181818;
  border-color: #ffffff0d;
  color: #ffffff;
}

.qb-dark-mode .qb-option.correct {
  background: #064e3b;
  border-color: #16a34a;
}

.qb-dark-mode .qb-option.wrong {
  background: #450a0a;
  border-color: #dc2626;
}

.qb-dark-mode .qb-exp {
  color: #00d084;
}

.qb-dark-mode .qb-bottom-nav {
  background: #181818;
  border-top-color: #ffffff0d;
}

.qb-dark-mode .qb-bottom-nav button {
  background: #212121;
  border-color: #ffffff0d;
  color: #ffffff;
}

/* ===============================
   EYE COMFORT
================================ */
.qb-eye-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 200, 120, 0.18);
  pointer-events: none;
  display: none;
  z-index: 100000;
}

.qb-eye-overlay.active {
  display: block;
}


/* Grid ONLY when image options exist */
.qb-options:has(.qb-option-has-image) {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Correct / Wrong states */
.qb-option.correct {
  border: 2px solid #22c55e;
  background: #dcfce7;
}

.qb-option.wrong {
  border: 2px solid #ef4444;
  background: #fee2e2;
}


/* ===============================
   OPEN BUTTON WRAPPER
================================ */

.qb-quiz-container {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ===============================
   OPEN BUTTON STYLING
================================ */

.qb-open-hindi,
.qb-open-english {
  border-radius: 3px;
  padding: 10px 18px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
font-size: 12px !important;
}

/* Hindi button (primary) */
.qb-open-hindi {
  background: #800020;
  color: #ffffff;
}

.qb-open-hindi:hover {
  background: #70001c;
  color: #e5e7eb;
}

/* English button (secondary) */
.qb-open-english {
  background: #ffffff;
  color: #800020;
	border: 1px solid #800020 !important;
}

.qb-open-english:hover  {
  background: #800020;
  color: #ffffff;
}

/* ===============================
   MOBILE VIEW
================================ */

@media (max-width: 640px) {

  .qb-quiz-container {
    flex-direction: column;
    align-items: stretch;
  }

  .qb-open-hindi,
  .qb-open-english {
    width: 100%;
    text-align: center;
  }
}

/* ===============================
   DESKTOP & LARGE SCREENS
================================ */

@media (min-width: 641px) {

  .qb-quiz-container {
    flex-direction: row;
    align-items: center;
  }

  .qb-open-hindi,
  .qb-open-english {
    width: 100%;
  }
}

