body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #f5f7fb !important;
}

.dashboard {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 280px;
  background-color: #fff;
  border-right: 1px solid #ddd;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 20px;
  color: #02055A;
}

.sidebar-header p {
  margin-top: 5px;
  font-size: 14px;
  color: #000137;
}

.unit-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.unit-list li {
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  color: #02198B;
}

.unit-list li:hover,
.unit-list li.active {
  background-color: #f0f4ff;
  font-weight: 500;
}

.unit-list li a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.main-content {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
}

.unit-card {
  background-color: white;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.unit-header h3 {
  margin: 0;
  color: #2c70f2;
}

.unit-header h3 a {
  text-decoration: none;
  color: #02055A;
}

.unit-topics ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.unit-topics li {
  margin-bottom: 8px;
  font-size: 15px;
  color: #000137;
}

.start-btn {
  padding: 10px 20px;
  background-color: #02198B;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.start-btn:hover {
  background-color: #253DA1;
}

@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  .main-content {
    padding: 16px;
  }

  .unit-card {
    margin-bottom: 20px;
  }

  .sidebar-header h2 {
    font-size: 18px;
  }

  .unit-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .start-btn {
    width: 100%;
    text-align: center;
  }
}

/* ===== HEADER STYLING ===== */
.sub-header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 8px 40px;   /* keeps header thin */
}

.sub-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;    /* allows items to wrap instead of being cut off */
  width: 100%;
  box-sizing: border-box;
}

/* LOGO FIX */
.logo {
  height: 45px;      /* force shrink */
  width: auto;       /* keep aspect ratio */
  display: inline-block;
}

/* NAV LINKS */
.navlinks {
  margin-right: 80px; /* decrease space from the right edge */
}

.navlinks ul {
  list-style: none;
  display: flex;
  gap: 25px;
}

.navlinks ul li a {
  text-decoration: none;
  color: #0a1d44;
  font-weight: 310;
  font-size: 13px;
}

.navlinks ul li a:hover {
  color: #99AFD7;
}

/* HIDE mobile menu icons by default */
.fa-bars, .fa-times {
  display: none;
}



/* Prevent horizontal scroll */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;  /* hides accidental overflow */
}

/* Make sure dashboard layout doesn't push wider */
.dashboard {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}


@media (max-width: 700px) {
  /* Make navlinks into a vertical slide-out menu */
  .navlinks {
    position: fixed;
    background: #fff;
    height: 100vh;
    width: 200px;
    top: 0;
    right: -200px;   /* start hidden off-screen */
    text-align: left;
    z-index: 1000;
    transition: 0.5s; /* smooth slide-in */
    padding-top: 60px;
    margin-right: 0; /* override desktop margin */
  }

  .navlinks ul {
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
  }

  .navlinks ul li a {
    font-size: 16px;
    font-weight: 400;
    color: #02198B; /* darker so it stands out on white */
  }

  /* Show hamburger and close icons */
  nav .fa-bars, nav .fa-times {
    display: block;
    font-size: 22px;
    color: #02198B;
    cursor: pointer;
    margin-left: 20px;
  }

  /* Position the close (X) button inside menu */
  .navlinks .fa-times {
    position: absolute;
    top: 20px;
    right: 20px;
  }

.macro-page nav .fa.fa-bars {
 color: #001C57;  /* dark blue instead of white */
}

.precalc-page nav .fa.fa-bars {
 color: #001C57;  /* dark blue instead of white */
}
}


.sidebar {
  width: 280px;
  background-color: #fff;
  border-right: 1px solid #ddd;
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.3s ease; /* smooth slide */
}

/* Phones: sidebar starts hidden */
@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%); /* off-screen */
    z-index: 2000;
  }

  .sidebar.open {
    transform: translateX(0); /* slide back in */
  }

  /* Show hamburger */
  .sidebar-toggle {
    display: block;
    font-size: 22px;
    color: #02198B;
    cursor: pointer;
    margin-left: 20px;
    z-index: 2100;
  }
}
/* Sidebar base */
.sidebar {
  width: 280px;
  background-color: #fff;
  border-right: 1px solid #ddd;
  padding: 20px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

/* Mobile: hide sidebar and show pull tab */
@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%); /* hidden */
    z-index: 2000;
  }

  .sidebar.open {
    transform: translateX(0); /* slide in */
  }

  /* Pull tab */
  .pull-tab {
    position: fixed;
    top: 30%;
    left: 0;
    transform: translateY(-50%);
    background: #001540;
    color: #fff;
    padding: 4px 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2100;
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 0 6px rgba(0,0,0,0.2);
width: 12px;
height: 60px;

  }

  /* Close button inside sidebar */
  .close-sidebar {
    display: block;
    background: none;
    border: none;
    font-size: 26px;
    color: #02198B;
    cursor: pointer;
    margin-bottom: 20px;
  }
}

/* Desktop: sidebar always visible, hide pull tab + close */
@media (min-width: 701px) {
  .pull-tab,
  .close-sidebar {
    display: none;
  }
}


@media (max-width: 700px) {
  .quiz {
    padding: 15px;             /* smaller padding */
    width: 100%;               /* take full screen width */
    max-width: 100%;           /* don’t restrict */
    box-sizing: border-box;    /* ensure padding stays inside */
    overflow-x: hidden;        /* prevent sideways scroll */
  }

  .choice-group {
    width: 100%;               /* let choices expand fully */
  }

  .choice {
    flex-wrap: wrap;           /* wrap long answer text */
    justify-content: flex-start;
  }

  .choice-text {
    flex: 1;                   /* let text take remaining space */
    min-width: 0;              /* allows wrapping instead of overflow */
    font-size: 15px;           /* slightly smaller on mobile */
    line-height: 1.4;
  }

  img, .question-image {
    max-width: 100%;           /* images shrink to screen */
    height: auto;
  }
}

