/* ===========================
   ROOT VARIABLES
   =========================== */
:root {
  --bg-color: #f4f4f9;
  --text-color: #333333;
  --box-bg: #ffffff;
  --box-border: #cce0ff;
  --link-color: #0077cc;
  --link-hover: #0055aa;
  --choice-bg: #eaf3fb;

  --bar-bg: #ffffff;
  --bar-text: #0055aa;
  --sidebar-bg: #f0f8ff;
  --sidebar-text: #003366;

  --hover-light: rgba(0, 123, 255, 0.12);
  --hover-dark: #3a3a3a;
  --hover-bg: var(--hover-light);
}

/* ===========================
   DARK MODE VARIABLES
   =========================== */
.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #f0f0f0;
  --box-bg: #222222;
  --box-border: #444444;
  --link-color: #66b2ff;
  --link-hover: #99ccff;
  --choice-bg: #2c313a;

  --bar-bg: #222222;
  --bar-text: #f0f0f0;
  --sidebar-bg: #333333;
  --sidebar-text: #f0f0f0;
  --hover-bg: var(--hover-dark);
}

/* ===========================
   GLOBAL ELEMENTS
   =========================== */
body, .subunit-container, .bottom-bar, .notes-box, #topbar-container, #sidebar-container {
  transition: background-color 1s, color 1s, border-color 1s;
}
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding-top: 60px; /* Matches .top-bar height */
  background-color: var(--bg-color);
  color: var(--text-color);
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.answer-options button.selected {
  background-color: #e0e7ff; /* light blue, neutral */
  color: #222;               /* normal text color */
}
/* Responsive font size for mobile */
@media (max-width: 600px) {
  body {
    font-size: 18px;
    padding: 1rem;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

html {
  scroll-behavior: smooth;
}
.section-anchor {
  scroll-margin-top: 120px; /* adjust based on your header height */
}
/* ===========================
   LINK STYLES
   =========================== */
a {
  text-decoration: none;
  color: var(--link-color);
  font-weight: bold;
}
a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* ===========================
   CONTAINER STYLES
   =========================== */
.container, .quiz-container {
  max-width: 100%;
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}

.container {
  max-width: 800px;
  margin: auto;
}

/* ===========================
   BOXES & COMMON COMPONENTS
   =========================== */
.box, .notes-box, .quiz-box, .question-box, .subunit-header, .subunit-content {
  background-color: var(--box-bg);
  color: var(--bar-text);
  border-color: var(--box-border);
}

.box {
  border: 2px solid var(--box-border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
@media (max-width: 600px) {
  .box {
    padding: 1.5rem;
    gap: 10px;
    margin-top: 60px;
  }
}

/* ===========================
   HEADERS
   =========================== */
h1, h2, h3 {
  color: var(--bar-text);
}
/* ===========================
   LISTS
   =========================== */
ul {
  list-style: none;
  padding-left: 0;
}

li {
  margin: 0.5rem 0;
}
ul.custom-block-list {
  list-style: none; /* Remove default bullets */
  padding-left: 0;
}

ul.custom-block-list li {
  position: relative;
  padding-left: 1.5em;
}

ul.custom-block-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 0.6em;
  height: 0.6em;
  background-color: var(--bar-text); 
  border-radius: 2px; 
}

/* ===========================
   COUNTDOWN TIMER
   =========================== */
.countdown {
  font-size: 1.2rem;
  text-align: center;
  color: var(--bar-text);
}

/* ===========================
   SUBUNIT STYLES
   =========================== */
.subunit-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-top: 20px;
  padding-left: 8px;
  padding-right: 8px;
}
@media (max-width: 600px) {
  .subunit-container {
    padding: 0;
    gap: 10px;
    margin-top: 60px;
  }
}
.subunit {
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--box-bg);
}
/* Spacing for first subunit 
.subunit:first-child {
  margin-top: 80px;
} */
/* Subunit header (collapsible) */
.subunit-header {
  background: none;
  color: var(--bar-text);
  border: none;
  font-size: 1.2rem;
  padding: 10px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}
.subunit-header.active {
  background-color: #007BFF;
  color: #fff;
}
body.dark-mode .subunit-header.active {
  background-color: #fff;
  color: #111;
}
/* Arrow indicator */
.subunit-header::after {
  content: ' ▾';
  display: inline-block;
  transition: transform 0.3s ease;
}
.subunit-header.active::after {
  transform: rotate(180deg);
}
/* Subunit header hover */
.subunit-header:hover {
  background-color: var(--hover-bg);
}

/* Collapsible content */
.subunit-content {
  display: none;
  padding: 10px 15px;
  background-color: var(--box-bg);
  color: var(--text-color);
  position: relative;
  z-index: 1;
}
.subunit-header.active + .subunit-content {
  display: block;
}

/* ===========================
   QUIZ BOX & QUESTIONS
   =========================== */
.quiz-box {
  background-color: var(--box-bg);
  border: 1px solid var(--box-border);
  padding: 15px;
  border-radius: 8px;
  margin-top: 30px;
}

.quiz-container {
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Segoe UI', sans-serif;
}

.question-box {
  background-color: var(--choice-bg);
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.question-text {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

/* ===========================
   QUIZ ANSWER & FEEDBACK
   =========================== */
.answer-options button, .choices li {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px 8px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Button hover */
.answer-options button:hover {
  background-color: #4a4a4a;
}

/* Correct/Incorrect styles */
.answer-options button.correct,
.choices li.correct {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
.answer-options button.incorrect,
.choices li.incorrect {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* Feedback text */
.feedback, .feedback-text {
  margin-top: 12px;
  font-style: italic;
  color: var(--bar-text);
}

/* ===========================
   NOTES BOX
   =========================== */
.notes-box {
  background-color: var(--box-bg);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  font-family: 'Segoe UI', sans-serif;
}

.notes-box h2 {
  color: var(--bar-text);
  margin-bottom: 12px;
}

.notes-box ul {
  padding-left: 20px;
  margin: 10px 0;
}

.notes-box li {
  margin-bottom: 6px;
}

/* ===========================
   CHEMISTRY TABLE
   =========================== */
.chem-table {
  width: 80%;
  margin: 30px auto;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: 'Segoe UI', sans-serif;
  border: 2px solid #333;
}

.chem-table td {
  border: 2px solid #333;
  padding: 16px;
  text-align: center;
  vertical-align: middle;
  background-color: #fefefe;
  color: #222;
  font-size: 1rem;
  letter-spacing: 0.5px;
  word-wrap: break-word;
}

/* Table header row */
.chem-table tr:first-child td {
  background-color: var(--hover-bg);
  font-weight: bold;
  color: var(--bar-text);
}

/* ===========================
   SECTION DIVIDER
   =========================== */
.section-divider {
  text-align: center;
  margin: 40px 0 20px;
}

.section-divider hr {
  border: none;
  border-top: 2px solid #ccc;
  margin-bottom: 10px;
}

.section-divider h3 {
  font-size: 1.4rem;
  color: var(--bar-text);
  margin-bottom: 8px;
}

.section-divider p {
  font-size: 1rem;
  color: var(--text-color);
}

/* ===========================
   TOP BAR
   =========================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  background-color: var(--bar-bg);
  color: var(--bar-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ===========================
   TITLE IN TOP BAR
   =========================== */
.unit-title {
  margin: 0;
  font-size: 1.2rem;
  flex-grow: 1;
  text-align: center;
  color: var(--bar-text);
}

/* ===========================
   ICONS IN TOP BAR
   =========================== */
.menu-icon,
.theme-toggle {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.theme-toggle:hover {
  outline: 2px solid var(--hover-bg);
  outline-offset: 2px;
}
.menu-icon:hover {
  outline: 2px solid var(--hover-bg);
  outline-offset: 2px;
}

/* ===========================
   SIDEBAR NAVIGATION
   =========================== */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 250px;
  height: calc(100% - 60px);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 999;
  background-color: var(--sidebar-bg);
  color: var(--link-color); /* text */
  padding: 20px;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
}
.sidebar.visible {
  transform: translateX(0);
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li {
  margin: 12px 0;
  padding: 0;
}
.sidebar li:first-child {
  margin-top: -4px;
}
.sidebar a {
  display: block;
  padding: 12px 16px;
  background-color: var(--box-bg);
  border-radius: 8px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.sidebar a:hover,
.sidebar a:focus {
  background-color: var(--hover-bg);
  transform: translateX(2px);
}
.sidebar a.active {
  background-color: var(--hover-bg);
  font-weight: bold;
  border-left: 4px solid var(--hover-bg);
}
/* === OVERLAY STYLES =========================== */
#sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px); /* Optional*/
}
.sidebar.visible + #sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

/* === SIGN IN & MODAL STYLES (restored & modernized) =========================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.58);
  overflow: auto;
}
.modal-content {
  background-color: var(--box-bg);
  color: var(--text-color);
  margin: 56px auto;
  padding: 2.5rem 2rem 2rem 2rem;
  border-radius: 16px;
  width: 94%;
  max-width: 410px;
  box-shadow: 0 6px 32px rgba(0,0,0,0.22), 0 2px 10px rgba(0,0,0,0.10);
  text-align: center;
  position: relative;
  border: 2px solid var(--box-border);
}
.close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--link-color);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
  line-height: 1;
}
.close:hover, .close:focus {
  color: var(--link-hover);
}

/* Modal headings */
.modal-content h2, .modal-content h3 {
  color: var(--bar-text);
  margin-top: 0;
  margin-bottom: 0.8em;
  font-size: 1.38em;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Modal text */
.modal-content p {
  color: var(--text-color);
  margin: 0.7em 0 1.2em 0;
  font-size: 1em;
  line-height: 1.6;
}

/* Divider for modal "or" */
.modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.7em 0 1.1em 0;
}
.modal-divider .modal-line {
  flex: 1;
  height: 1.5px;
  background: var(--box-border);
  margin: 0 12px;
  border-radius: 1px;
}
.modal-divider .modal-divider-text {
  font-weight: 500;
  color: var(--bar-text);
  font-size: 1.1em;
  white-space: nowrap;
}

/* Modal button styles */
.modal-content button,
.modal-content input[type="button"] {
  background: var(--link-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.85em 1.7em;
  margin: 1em 0;
  cursor: pointer;
  font-size: 1.08em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
  max-width: 100%;
  display: block;
}
.modal-content button:hover {
  background: var(--link-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Google sign-in button */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  background: #fff;
  color: #222;
  border: 1px solid var(--box-border);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  font-weight: 600;
  font-size: 1.08em;
  padding: 0.85em 1.7em;
  margin: 1em 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  width: 100%;
  max-width: 100%;
}
.google-signin-btn:hover {
  background: var(--choice-bg);
  color: #111;
}

/* For SVG icon in button */
.google-signin-btn svg {
  height: 1.2em;
  width: 1.2em;
  vertical-align: middle;
  margin-right: 0.5em;
}

/* Input fields in modals */
.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="email"] {
  width: 85%;
  padding: 0.7em 1em;
  margin: 0.7em 0 1em 0;
  border: 1.5px solid var(--box-border);
  border-radius: 7px;
  font-size: 1.08em;
  background: var(--box-bg);
  color: var(--text-color);
  box-sizing: border-box;
  transition: border 0.2s;
}
.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus,
.modal-content input[type="email"]:focus {
  border-color: var(--link-color);
  outline: none;
}

/* Modal in dark mode */
body.dark-mode .modal-content {
  background-color: var(--box-bg);
  color: var(--text-color);
  border-color: var(--box-border);
}
body.dark-mode .modal-divider .modal-line,
body.dark-mode .modal-content input,
body.dark-mode .google-signin-btn {
  background: var(--box-bg);
  border-color: var(--box-border);
  color: var(--text-color);
}
body.dark-mode .google-signin-btn {
  color: #f0f0f0;
  background: #222;
}
body.dark-mode .modal-content button,
body.dark-mode .modal-content input[type="button"] {
  background: var(--link-color);
  color: #f0f0f0;
}
body.dark-mode .modal-content button:hover {
  background: var(--link-hover);
  color: #fff;
}
body.dark-mode .close {
  color: var(--link-color);
}
body.dark-mode .close:hover,
body.dark-mode .close:focus {
  color: var(--link-hover);
}

/* Mobile modal responsiveness */
@media (max-width: 600px) {
  .modal-content {
    padding: 1.3rem 0.6rem 1.2rem 0.6rem;
    max-width: 98vw;
    border-radius: 11px;
    font-size: 1em;
    margin: 32px auto;
  }
  .close {
    top: 8px;
    right: 11px;
    font-size: 2.1rem;
  }
}

/* ===========================
   END OF FILE
   =========================== */
/* ===========================
   BOTTOM BAR
   =========================== */
#unitsBottomBar.bottom-bar {
  width: 100%;
  background: #1a237e;
  color: #fff;
  display: flex;
  align-items: center;
  position: relative; /* Needed for absolute centering */
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 0;
  margin-top: 2rem;
  min-height: 56px;
}

.bottom-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
  min-width: 180px;
  flex: 0 0 auto;
}
.bottom-bar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 1;
}
.bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  min-width: 150px;
  flex: 0 0 auto;
  margin-left: auto; /* ensures alignment to the far right */
}

#unitsBottomBar button {
  background: #3949ab;
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
#unitsBottomBar button:hover:not(:disabled) {
  background: #303f9f;
}
#futureFeatureBtn {
  background: #757575;
  cursor: not-allowed;
}

/* mobile fix */
@media (max-width: 600px) {
  #unitsBottomBar.bottom-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.5rem;
    font-size: 0.95rem;
    gap: 0.5rem;
    min-height: unset;
    position: static;
  }
  .bottom-bar-left,
  .bottom-bar-center,
  .bottom-bar-right {
    position: static !important;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: unset;
    width: 100%;
    margin-bottom: 0.5rem;
    left: unset !important;
    top: unset !important;
    transform: unset !important;
  }
  #unitsBottomBar button {
    width: 100%;
    min-width: unset;
    margin-bottom: 0.5rem;
  }
}

/* === BOTTOM BAR DARK MODE ========== */
body.dark-mode #unitsBottomBar.bottom-bar {
  background: var(--bar-bg);
  color: var(--bar-text);
  border-top: 1px solid var(--box-border);
}
body.dark-mode #unitsBottomBar button {
  background: #343456;
  color: #f0f0f0;
  border: 1px solid #44445a;
}
body.dark-mode #unitsBottomBar button:hover:not(:disabled) {
  background: #44445a;
  color: #fff;
  border-color: #5d5d7a;
}
body.dark-mode #futureFeatureBtn {
  background: #444444;
  color: #757575;
}

/* ===========================
   SUBUNIT COMPLETION CHECKMARKS
   =========================== */
.subunit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
  gap: 1rem;
}

.subunit-title {
  flex: 1 1 auto;
}

.subunit-checkmark {
  color: #43a047;
  font-size: 1.5em;
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: 1rem;
}

.subunit-header.completed .subunit-checkmark {
  opacity: 1;
}

.subunit-header::after {
  content: ' ▾';
  font-size: 1.2em;
  margin-left: 0.5em;
  color: inherit;
  transition: transform 0.3s;
}
.subunit-header.active::after {
  transform: rotate(180deg);
}
/* ===========================
   INDEX PAGE BOTTOM BAR
   =========================== */
#indexBottomBar.bottom-bar {
  width: 100%;
  background: #1a237e;
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 0;
  margin-top: 2rem;
  min-height: 56px;
  z-index: 900;
}

#indexBottomBar .bottom-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-start;
  min-width: 180px;
  flex: 0 0 auto;
}
#indexBottomBar .bottom-bar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 1;
}
#indexBottomBar .bottom-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  min-width: 150px;
  flex: 0 0 auto;
  margin-left: auto;
}

#indexBottomBar button {
  background: #3949ab;
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
#indexBottomBar button:hover:not(:disabled) {
  background: #303f9f;
}

/* Mobile fix */
@media (max-width: 600px) {
  #indexBottomBar.bottom-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.5rem;
    font-size: 0.95rem;
    gap: 0.5rem;
    min-height: unset;
    position: static;
  }
  #indexBottomBar .bottom-bar-left,
  #indexBottomBar .bottom-bar-center,
  #indexBottomBar .bottom-bar-right {
    position: static !important;
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: unset;
    width: 100%;
    margin-bottom: 0.5rem;
    left: unset !important;
    top: unset !important;
    transform: unset !important;
  }
  #indexBottomBar button {
    width: 100%;
    min-width: unset;
    margin-bottom: 0.5rem;
  }
}

/* Dark mode for index bottom bar */
body.dark-mode #indexBottomBar.bottom-bar {
  background: var(--bar-bg);
  color: var(--bar-text);
  border-top: 1px solid var(--box-border);
}
body.dark-mode #indexBottomBar button {
  background: #343456;
  color: #f0f0f0;
  border: 1px solid #44445a;
}
body.dark-mode #indexBottomBar button:hover:not(:disabled) {
  background: #44445a;
  color: #fff;
  border-color: #5d5d7a;
}
/* ===========================
   MODAL TAB BUTTONS (Register / Sign In)
   =========================== */

/* Tabs container */
.tab-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1em;
  background: var(--choice-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* Individual tab button */
.tabSignIn,
.tabRegister {
  flex: 1 1 0;
  padding: 0.55em 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.08em;
  color: var(--bar-text);
  background: none;
  border: none;
  border-right: 1px solid var(--box-border);
  transition: background 0.18s, color 0.18s;
  outline: none;
}
.tabRegister:last-child,
.tabSignIn:last-child {
  border-right: none;
}

/* Active tab */
.tabSignIn.active,
.tabRegister.active {
  background: var(--box-bg);
  color: var(--link-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-bottom: 3px solid var(--link-color);
  z-index: 1;
}

/* Focus and hover states */
.tabSignIn:hover:not(.active),
.tabRegister:hover:not(.active) {
  background: var(--hover-bg);
  color: var(--link-hover);
}

body.dark-mode .tab-buttons {
  background: var(--choice-bg);
}
body.dark-mode .tabSignIn,
body.dark-mode .tabRegister {
  color: var(--bar-text);
  background: none;
  border-right: 1px solid var(--box-border);
}
body.dark-mode .tabSignIn.active,
body.dark-mode .tabRegister.active {
  background: var(--box-bg);
  color: var(--link-color);
  border-bottom: 3px solid var(--link-color);
}
body.dark-mode .tabSignIn:hover:not(.active),
body.dark-mode .tabRegister:hover:not(.active) {
  background: var(--hover-bg);
  color: var(--link-hover);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .tab-buttons {
    font-size: 1em;
    border-radius: 6px;
  }
  .tabSignIn,
  .tabRegister {
    padding: 0.45em 0;
    font-size: 1em;
  }
}

/* final quiz */
.quiz-box .quizTimer {
  font-size: 1.1em;
  font-weight: bold;
  background: var(--choice-bg);
  padding: 8px 18px;
  border-radius: 8px;
  color: var(--text-color);
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: inline-block;
}

.quiz-box .quizScore {
  font-size: 1em;
  font-weight: 500;
  margin-top: 6px;
  margin-bottom: 12px;
  color: var(--text-color);
  background: var(--choice-bg);
  border-radius: 8px;
  padding: 6px 16px;
  display: inline-block;
}

.final-quiz-box .answer-options button {
  border: 1.5px solid var(--box-border);
  background: var(--choice-bg);
  color: var(--text-color);
  border-radius: 7px;
  font-size: 16px;
  padding: 11px 6px;
  margin: 7px 0;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.final-quiz-box .answer-options button.selected {
  background: var(--box-bg);
  color: var(--text-color);
  border-color: var(--box-border);
}

.final-quiz-box .final-quiz-submit-btn {
  margin-top: 18px;
  font-size: 17px;
  font-weight: bold;
  background: var(--box-bg);
  color: var(--text-color);
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0,0,0,0.07);
  transition: background 0.2s, color 0.2s;
}
.final-quiz-box .final-quiz-submit-btn:disabled {
  background: var(--box-border);
  color: #eee;
  cursor: not-allowed;
}

.quiz-container, .quiz-box {
  text-align: center;
}

.final-quiz-box .answer-options button,
.quiz-box .startQuizBtn,
.final-quiz-box .final-quiz-submit-btn {
  display: inline-block;
  margin: 12px auto;
}

.final-quiz-box .final-quiz-submit-btn {
  margin-top: 18px;
  font-size: 17px;
  font-weight: bold;
  background: var(--box-bg);
  color: var(--text-color);
  border: 2px solid var(--box-border);
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0,0,0,0.07);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.final-quiz-box .final-quiz-submit-btn:disabled {
  background: var(--box-border);
  color: #eee;
  cursor: not-allowed;
  border-color: var(--box-border);
}

/* Ensure correct/incorrect show up -- add !important for reliability */
.final-quiz-box .answer-options button.correct {
  background-color: #d4edda !important;
  color: #176317 !important;
  border-color: #176317 !important;
}
.final-quiz-box .answer-options button.incorrect {
  background-color: #f8d7da !important;
  color: #a21a1a !important;
  border-color: #a21a1a !important;
}

.quiz-box.final-quiz-box {
  text-align: center;
}

.quiz-box.final-quiz-box .quizTimer,
.quiz-box.final-quiz-box .quizScore {
  display: block;
  margin: 0 auto 10px auto;
}

.quiz-box.final-quiz-box .startQuizBtn {
  display: inline-block;
  margin: 16px auto 16px auto;
  font-size: 17px;
  font-weight: bold;
  background: var(--box-bg);
  color: var(--text-color);
  border: 2px solid var(--box-border);
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(0,0,0,0.07);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.quiz-box.final-quiz-box .startQuizBtn:disabled {
  background: var(--box-border);
  color: #eee;
  cursor: not-allowed;
  border-color: var(--box-border);
}

/* QOTD */
.qotd-question-area {
  position: relative;
}

.qotd-question-content {
  filter: none;
  pointer-events: auto;
  transition: filter 0.3s;
}

.qotd-blur-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: 8px;
}

.qotd-question-content.blurred {
  filter: blur(6px);
  pointer-events: none;
}

Copilot said: ```css /* --- QOTD Box and Layout ---
CSS
/* --- QOTD Box and Layout --- */
.box {
  border-radius: 16px;
  background: var(--box-bg);
  padding: 2.2em 2em 1.3em 2em;
  box-shadow: 0 2px 18px rgba(0,0,0,0.11);
  margin-bottom: 2em;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  border: 1.5px solid var(--box-border);
}

/* --- Blur Overlay --- */
.qotd-blur-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(5px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.qotd-blur-overlay button {
  font-size: 1.08em;
  font-weight: 600;
  padding: 0.7em 1.7em;
  border-radius: 8px;
  border: none;
  background: var(--choice-bg);
  color: var(--bar-text);
  box-shadow: 0 1px 5px rgba(0,0,0,0.09);
  cursor: pointer;
  transition: background 0.18s;
}
.qotd-blur-overlay button:hover { background: var(--hover-bg); }

.qotd-question-area {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.1em;
}

.qotd-question-content {
  border-radius: 14px;
  background: var(--box-bg);
  padding: 1.1em 0.7em;
  min-height: 90px;
}

.qotd-question-content.blurred {
  filter: blur(3.5px);
  pointer-events: none;
  user-select: none;
}

/* --- Actions Row --- */
.qotd-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 1.3em;
  justify-content: flex-start;
  position: relative;
}

/* --- Streak Icon --- */
.qotd-streak {
  font-size: 1.4em;
  background: #ffe1a6;
  color: #ff8800;
  padding: 0.45em 0.82em;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(255,140,0,0.08);
  margin-right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
}

#qotdLeaderboardBtn,
#qotdStatsBtn {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  background: var(--choice-bg);
  color: var(--bar-text);
  padding: 0.7em 1.2em;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: background 0.18s;
}

#qotdLeaderboardBtn:hover,
#qotdStatsBtn:hover {
  background: var(--hover-bg);
}

#qotdStatsBtn {
  flex: 0 0 130px;
  min-width: 130px;
  text-align: center;
}

#qotdLeaderboardBtn {
  flex: 1 1 auto;
  min-width: 90px;
  text-align: center;
}

@media (max-width: 500px) {
  .box {
    padding: 1.2em 0.2em 0.8em 0.2em;
  }
  .qotd-actions {
    gap: 8px;
  }
  #qotdStatsBtn {
    min-width: 92px;
    font-size: 0.97em;
  }
  #qotdLeaderboardBtn {
    min-width: 60px;
    font-size: 0.97em;
  }
  .qotd-streak {
    min-width: 32px;
    min-height: 32px;
    font-size: 1.15em;
  }
}

#qotdSignInBtn,
#qotdSubmitBtn {
  border: var(--box-border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  background: var(--choice-bg);
  color: var(--bar-text);
  padding: 0.7em 1.7em;
  box-shadow: 0 1px 5px rgba(0,0,0,0.09);
  cursor: pointer;
  margin-top: 0.3em;
  transition: background 0.18s;
  display: inline-block;
}

#qotdSignInBtn:hover,
#qotdSubmitBtn:hover {
  background: var(--hover-bg);
}

.qotd-feedback {
  font-size: 1.11em;
  margin-top: 1em;
  font-weight: 600;
  text-align: center;
}
.qotd-feedback.correct { color: #3fad32; }
.qotd-feedback.incorrect { color: #d12e2e; }

.streak-container {
  position: relative;
  display: inline-block;
}

.streak-tooltip {
  position: absolute;
  background: var(--box-bg);
  color: var(--bar-text);
  border: 2px solid var(--box-border);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 1em;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  z-index: 1200;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.18s;
}

.modal-content { position: relative; }

@media (max-width: 500px) {
  .modal-content {
    padding: 14px 4px;
    max-width: 99vw;
    font-size: 0.88rem;
  }
  .modal-title {
    font-size: 1rem;
    margin-bottom: 9px;
  }
  .modal-btn {
    padding: 5px 8px;
    font-size: 0.88rem;
    margin: 8px 3px 0 0;
    min-width: 0;
    min-height: 0;
    line-height: 1.2;
    border-radius: 6px;
    /* If you want all buttons in one row, add: */
    display: inline-block;
    vertical-align: middle;
  }
  .modal-btn .icon {
    font-size: 1em !important; /* Standardize icon size */
    margin-right: 2px;
  }
  .stats-list li, .leaderboard-list li {
    font-size: 0.88rem;
  }
  .streak-number, .fire-icon {
    font-size: 1em !important;
  }
}

/* Make leaderboard, stats, and streak buttons smaller on small screens */
@media (max-width: 600px) {
  #qotdStatsBtn,
  #qotdLeaderboardBtn,
  #qotdStreak {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    min-width: 60px !important;
    height: 28px !important;
    border-radius: 6px !important;
    margin: 3px !important;
  }

  /* If leaderboard uses <button>s inside .leaderboard-list, shrink them too */
  .leaderboard-list button {
    font-size: 0.85rem !important;
    padding: 6px 12px !important;
    min-width: 60px !important;
    height: 28px !important;
    border-radius: 6px !important;
    margin: 3px !important;
  }

  /* Shrink fire icon and streak number inside #qotdStreak */
  #qotdStreak .streak-number,
  #qotdStreak .fire-icon {
    font-size: 1rem !important;
    vertical-align: middle;
  }

  /* You can target modal close buttons too if needed */
  .modal-close {
    font-size: 1rem !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
  }
   .button-row {
  display: flex;
  gap: 8px;
}
#qotdLeaderboardBtn { flex: 2; }
#qotdStatsBtn { flex: 1; }
}


/* INDEX PAGE UNIT BUTTONS - UPDATED */
.unit-btn {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--box-bg);
  border: 2px solid var(--box-border);
  border-radius: 12px;
  margin-bottom: 18px;
  padding: 13px 18px; /* Reduced height */
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  font-size: 1.03rem; /* Slightly smaller */
  color: var(--text-color);
}

.unit-btn:hover, .unit-btn:focus {
  background: var(--choice-bg);
  border-color: var(--accent, #8bc34a);
  box-shadow: 0 4px 16px rgba(76,175,80,0.12);
}

.unit-btn-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.unit-title {
  font-size: 1.08em;
  font-weight: 500;
  color: var(--heading-color, var(--bar-text)); /* Matches title of unit buttons box */
}

.unit-progress-bar {
  margin-top: 7px;
  height: 7px;
  background: #bdbdbd; /* Always gray, both themes */
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  position: relative;
}

body.dark-mode .unit-progress-bar {
  background: #44445a; /* Override for dark mode - matches your dark box borders */
}

.unit-progress-fill {
  height: 100%;
  background: var(--accent, #43a047);
  border-radius: 4px;
  width: 0%; /* Set dynamically */
  transition: width 0.3s;
}

.unit-btn-divider {
  width: 2px;
  height: 38px; /* Reduced height for shorter buttons */
  background: var(--box-border);
  margin: 0 14px; /* Slightly narrower gap */
  border-radius: 1px;
  opacity: 0.55;
}

.unit-percent {
  font-size: 0.99em;
  font-weight: 600;
  min-width: 44px;
  text-align: right;
  color: var(--accent, #43a047);
  letter-spacing: 0.5px;
}
.unit-btn {
  transition:
    box-shadow 0.15s,
    border-color 0.15s,
    background 0.15s,
    transform 0.16s cubic-bezier(.5,1.5,.6,1);
}
.unit-btn:hover,
.unit-btn:focus {
  background: var(--choice-bg);
  border-color: var(--accent, #8bc34a);
  box-shadow: 0 4px 16px rgba(76,175,80,0.12);
  transform: translateX(16px); /* Slides right on hover */
}
.unit-btn .unit-title {
  color: var(--bar-text); /* fallback to blue if --bar-text not set */
}



/* SCORE CCALCULATOR */
.calc-title {
  color: var(--bar-text, #3949ab);
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 0.2em;
  text-align: center;
}
.calc-desc {
  color: var(--bar-text, #3949ab);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 1.2em;
}
.calc-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--bar-text, #3949ab);
  margin-bottom: 0.7em;
  margin-top: 0.6em;
}
.calc-slider {
  width: 100%;
  accent-color: var(--bar-text, #3949ab);
  margin-bottom: 0.3em;
  height: 1.3em;
}
.calc-score-label {
  text-align: right;
  font-size: 1.1em;
  color: var(--bar-text, #3949ab);
  margin-bottom: 0.7em;
}
.calc-divider {
  border: none;
  border-top: 2px solid var(--bar-text, #3949ab);
  margin: 1.2em 0;
}
.calc-frq-group {
  margin-bottom: 1.3em;
}
.calc-frq-subtitle {
  color: var(--bar-text, #3949ab);
  font-size: 1.05em;
  margin-bottom: 0.5em;
  margin-top: 0.2em;
  font-weight: 500;
}
.calc-frq-row {
  display: flex;
  gap: 1.1em;
  align-items: center;
  flex-wrap: wrap;
}

/* UPDATED: Use --choice-bg for backgrounds. Set main score text color to --bar-text for visibility */
.calc-frq-score-box {
  background: var(--choice-bg, #2c313a);
  color: var(--bar-text, #f0f0f0); /* <-- Main text uses bar-text variable now */
  border-radius: 7px;
  border: 1.5px solid var(--bar-text, #3949ab);
  min-width: 60px;
  padding: 0.4em 0.7em 0.3em 0.7em;
  text-align: center;
  margin-bottom: 0.3em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18em;
  position: relative;
  font-size: 1.07em;
  box-shadow: 0 1px 3px rgba(60,80,200,0.03);
}
.calc-frq-setall {
  margin-left: auto;
  min-width: 65px;
  background: var(--choice-bg, #2c313a);
  color: var(--bar-text, #f0f0f0); /* <-- Main text uses bar-text variable now */
  border-color: #b3c0fc;
}
.calc-frq-setall-label {
  font-size: 0.95em;
  color: var(--bar-text, #3949ab);
  font-weight: 500;
  margin-bottom: 0.17em;
}
.calc-score-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.2em;
}
.calc-score-title {
  font-size: 1.27rem;
  font-weight: bold;
  color: var(--bar-text, #3949ab);
  margin-bottom: 0.17em;
  text-align: center;
}
/* Main predicted score uses bar-text variable for the main score */
.calc-score-predicted {
  color: var(--bar-text, #f0f0f0); /* <-- Main text uses bar-text variable now */
  background: var(--choice-bg, #2c313a);
  border-radius: 12px;
  padding: 0.3em 1.1em;
  font-size: 2.3rem;
  font-weight: bold;
  margin-top: 0.2em;
  box-shadow: 0 2px 16px rgba(60,80,200,0.14);
}
.calc-frq-score {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0.2em 0;
}
.calc-arrow {
  background: var(--bar-text, #3949ab);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 1.25em;
  height: 1.25em;
  font-size: 1.2em;
  margin: 0.1em 0;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calc-arrow:active {
  background: #283593;
}
.calc-frq-label {
  font-size: 0.8em;
  color: #888;
  margin-bottom: 2px;
}

@media (max-width: 600px) {
  .calc-frq-row {
    gap: 0.4em;
  }
  .calc-frq-score-box {
    min-width: 38px;
    padding: 0.23em 0.36em 0.2em 0.36em;
    font-size: 0.95em;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(60,80,200,0.03);
  }
  .calc-frq-label {
    font-size: 0.72em;
    margin-bottom: 1px;
  }
  .calc-frq-score {
    font-size: 0.98em;
    margin: 0.11em 0;
  }
  .calc-arrow {
    width: 1em;
    height: 1em;
    font-size: 1.05em;
    margin: 0.08em 0;
    border-radius: 3px;
  }
  .calc-frq-setall {
    min-width: 42px;
    font-size: 0.95em;
    padding: 0.23em 0.36em 0.2em 0.36em;
  }
}

.calc-full-link {
  margin-top: 1em; /* or 16px, or whatever spacing you like */
  text-align: center;
}



/* GATING MODAL ITEMS */
.modal-header h2 {
  margin-bottom: 0.3em;
  font-size: 1.25em;
  font-weight: 600;
  text-align: center;
}
.modal-divider {
  border: none;
  border-top: 2px solid #3949ab; /* adjust for your theme */
  margin: 0.5em auto 1em auto;
  width: 80%;
}
.modal-benefits {
  margin: 0;
  padding-left: 0;
  color: #222;
  font-size: 1.08em;
  text-align: left;
  list-style: none;
}
.modal-benefits li {
  margin-bottom: 0.6em;
  display: flex;
  align-items: start;
}
.checkmark {
  color: #43a047; /* green */
  font-weight: bold;
  margin-right: 0.5em;
  font-size: 1.2em;
  line-height: 1;
}
.signup-privacy-note {
  text-align: center;
  font-size: 0.93em;
  color: #888;
  margin-top: 1em;
}
body.dark-mode .modal-benefits {
  color: var(--bar-text);
}
body.dark-mode .signup-privacy-note {
  color: #bbb;
}




/* INDEX ONBOARDING                     ------------   */
.index-intro-box h1 {
  font-size: 2em;
  margin-bottom: 0.5em;
  font-weight: 700;
}
.index-intro-box p {
  font-size: 1.13em;
  margin-bottom: 1.2em;
  line-height: 1.5;
}
.index-highlight {
  color: #3949ab;
  font-weight: bold;
}
body.dark-mode .index-intro-box {
  background: #222242;
  color: #f0f0f0;
}
body.dark-mode .index-highlight {
  color: #66b2ff;
}
.index-intro-divider {
  border: none;
  border-top: 2.5px solid #3949ab;
  margin: 1.3em auto 1.5em auto;
  width: 70%;
}
.index-page-contents h3 {
  margin-bottom: 0.4em;
  font-size: 1.12em;
  font-weight: 600;
}
.index-page-contents ul {
  list-style: disc inside;
  padding-left: 0;
  margin: 0 auto;
  max-width: 700px;
  text-align: left;
  display: inline-block;
}
.index-page-contents li {
  margin-bottom: 0.35em;
  font-size: 1.01em;
}
.index-page-contents a {
  color: #3949ab;
  text-decoration: underline;
  transition: color 0.2s;
}
.index-page-contents a:hover {
  color: #303f9f;
}
body.dark-mode .index-page-contents a {
  color: #66b2ff;
}
body.dark-mode .index-page-contents a:hover {
  color: #99ccff;
}
