/* ======================================================
   Glucose Wiki — Unified Main Stylesheet
   Rev. 2025-11-04
   ====================================================== */

/* ==========================
   1. ROOT THEME VARIABLES
   ========================== */
:root {
  --primary: #6a55d3;
  --primary-dark: #4b3cb5;
  --accent: #9a8aff;
  --light-bg: #f8f7ff;
  --text: #1a1a1a;
  --text-light: #4a4a4a;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
  --font-display: 'Cinzel Decorative', serif;
  --font-body: 'Quicksand', sans-serif;
}

/* ==========================
   2. RESET & GLOBAL
   ========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at center, #f5f4ff 0%, #e3dcff 45%, #c9c3ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ==========================
   3. TYPOGRAPHY
   ========================== */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--primary-dark);
  margin-bottom: 0.6em;
}
p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-light);
}
a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.3s ease, transform 0.25s ease;
}
a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================
   4. NAVIGATION BAR
   ========================== */
header {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
nav a {
  font-weight: 500;
  color: var(--primary-dark);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all 0.25s ease;
}
nav a:hover {
  background: rgba(255,255,255,0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ==========================
   5. LANDING CONTAINER (HOME + COURSES)
   ========================== */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem 6rem;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}
.logo-title {
  font-family: var(--font-display);
  font-size: 3.3rem;
  color: var(--primary-dark);
  margin-bottom: 3rem;
  text-shadow: 0 2px 10px rgba(255,255,255,0.4);
}
.slogan {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ==========================
   6. INDEX PAGE GRID (HOME)
   ========================== */
.box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
}
.box {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.box:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.box h2 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}
.box p {
  color: var(--text-light);
}

/* Responsive Grid */
@media (max-width: 960px) {
  .box-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .box-grid { grid-template-columns: 1fr; }
}

/* ==========================
   7. COURSE SECTIONS
   ========================== */
.course-section {
  text-align: center;
  padding: 4rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.course-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.course-card {
  position: relative;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.3s ease;
}
.course-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.course-card h3 {
  color: var(--primary-dark);
  margin-bottom: 0.8rem;
}
.course-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.2rem;
}

/* Buttons */
.enroll-btn {
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.enroll-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

/* ==========================
   8. TOOLTIP HOVERS
   ========================== */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60,44,165,0.9);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 90%;
  max-width: 240px;
}
.course-card:hover .tooltip {
  opacity: 1;
}

/* ==========================
   9. MISSION OVERLAY
   ========================== */
.mission-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 2000;
}
.mission-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

.mission-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1500;
}
.mission-overlay.active {
  opacity: 1;
  visibility: visible;
}
.mission-content {
  background: rgba(255,255,255,0.85);
  border-radius: 18px;
  padding: 2.5rem;
  max-width: 700px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.4);
}
.mission-content h3 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--primary-dark);
}
.mission-content p {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.close-mission {
  background: var(--primary-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* ==========================
   10. BACK TO TOP BUTTON (FINAL)
   ========================== */
.back-to-top {
  position: fixed !important;
  bottom: 2rem !important;
  left: 2rem !important;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  z-index: 3000;
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.back-to-top::before {
  content: "↑";
  font-size: 1.5rem;
}

/* ==========================
   11. FOOTER
   ========================== */
footer {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  font-size: 0.95rem;
  color: var(--text-light);
  border-top: 1px solid rgba(255,255,255,0.4);
}
footer p {
  margin-bottom: 0.5rem;
}

/* ==========================
   12. RESPONSIVE TWEAKS
   ========================== */
@media (max-width: 768px) {
  .logo-title { font-size: 2.4rem; }
  .slogan { font-size: 1rem; }
  .mission-btn {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.9rem;
  }
}
@media (max-width: 480px) {
  .enroll-btn { width: 100%; }
  .course-card { padding: 1.6rem; }
  .mission-content { padding: 1.5rem; }
}
/* ==========================
   TOOLTIP RESTORE & GLOW
   ========================== */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60, 44, 165, 0.9);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 90%;
  max-width: 240px;
  box-shadow: 0 0 12px rgba(120, 100, 255, 0.4);
}
.course-card:hover .tooltip {
  opacity: 1;
}
/* ==========================
   DARK MODE THEME
   ========================== */
body.dark-mode {
  background: radial-gradient(circle at center, #1c1a28 0%, #2b2445 50%, #1a1629 100%);
  color: #e0e0ff;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #c7baff;
}
body.dark-mode p { color: #d4d4e8; }

body.dark-mode .box,
body.dark-mode .course-card,
body.dark-mode .content-panel,
body.dark-mode .sidebar {
  background: rgba(40, 40, 60, 0.85);
  border-color: rgba(150, 130, 255, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

body.dark-mode .enroll-btn {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
  box-shadow: 0 4px 18px rgba(80, 60, 200, 0.5);
}
body.dark-mode .enroll-btn:hover {
  background: linear-gradient(135deg, #7b68ee 0%, #c1b0ff 100%);
}

body.dark-mode .mission-content {
  background: rgba(30, 30, 50, 0.9);
  color: #d0caff;
}

body.dark-mode .mission-btn {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
}

/* Tooltip dark mode */
body.dark-mode .tooltip {
  background: rgba(150, 130, 255, 0.95);
  color: #1a1a1a;
  box-shadow: 0 0 12px rgba(180, 160, 255, 0.5);
}

/* ==========================
   DARK MODE TOGGLE BUTTON
   ========================== */
.dark-toggle-btn {
  position: fixed;
  top: 2rem;
  right: 6rem;
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 2500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
.dark-toggle-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

/* ======================================================
   13. RESPONSIVE LAYOUT — COURSE GRID & PAGE SPACING
   ====================================================== */

/* ---------- Large tablets / small laptops ---------- */
@media (max-width: 1024px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
    padding: 0 1rem;
  }

  .landing-container {
    padding: 3rem 1rem 4rem;
  }

  .course-section h2 {
    font-size: 1.8rem;
  }

  .course-card {
    padding: 1.8rem;
  }
}

/* ---------- Tablets & Large Phones ---------- */
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: 1fr;
    max-width: 90%;
  }

  .course-card {
    margin: 0 auto;
    padding: 1.8rem 1.4rem;
  }

  .logo-title {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
  }

  .slogan {
    font-size: 1rem;
    margin-bottom: 1.8rem;
  }

  .mission-btn,
  .dark-toggle-btn,
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.85rem;
    width: 50px;
    height: 50px;
  }

  .dark-toggle-btn {
    right: 5rem;
  }
}

/* ---------- Small Phones (<480px) ---------- */
@media (max-width: 480px) {
  .course-section {
    padding: 2.5rem 1rem;
  }

  .course-grid {
    gap: 1.4rem;
    max-width: 95%;
  }

  .course-card {
    padding: 1.5rem;
  }

  .enroll-btn {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .mission-content {
    width: 90%;
    padding: 1.2rem;
  }

  .logo-title {
    font-size: 2rem;
  }

  .tooltip {
    font-size: 0.75rem;
    max-width: 200px;
  }
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 15px rgba(154, 138, 255, 0.7),
              0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ======================================================
   Glucose Wiki — Unified Main Stylesheet
   Rev. 2025-11-04
   ====================================================== */

/* ==========================
   1. ROOT THEME VARIABLES
   ========================== */
:root {
  --primary: #6a55d3;
  --primary-dark: #4b3cb5;
  --accent: #9a8aff;
  --light-bg: #f8f7ff;
  --text: #1a1a1a;
  --text-light: #4a4a4a;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
  --font-display: 'Cinzel Decorative', serif;
  --font-body: 'Quicksand', sans-serif;
}

/* ==========================
   2. RESET & GLOBAL
   ========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at center, #f5f4ff 0%, #e3dcff 45%, #c9c3ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ==========================
   3. TYPOGRAPHY
   ========================== */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--primary-dark);
  margin-bottom: 0.6em;
}
p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-light);
}
a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.3s ease, transform 0.25s ease;
}
a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================
   4. NAVIGATION BAR
   ========================== */
header {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
nav a {
  font-weight: 500;
  color: var(--primary-dark);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: all 0.25s ease;
}
nav a:hover {
  background: rgba(255,255,255,0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* ==========================
   5. LANDING CONTAINER (HOME + COURSES)
   ========================== */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem 6rem;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}
.logo-title {
  font-family: var(--font-display);
  font-size: 3.3rem;
  color: var(--primary-dark);
  margin-bottom: 3rem;
  text-shadow: 0 2px 10px rgba(255,255,255,0.4);
}
.slogan {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ==========================
   6. INDEX PAGE GRID (HOME)
   ========================== */
.box-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
}
.box {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.box:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.box h2 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
}
.box p {
  color: var(--text-light);
}

/* Responsive Grid */
@media (max-width: 960px) {
  .box-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .box-grid { grid-template-columns: 1fr; }
}

/* ==========================
   7. COURSE SECTIONS
   ========================== */
.course-section {
  text-align: center;
  padding: 4rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.course-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.course-card {
  position: relative;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.4);
  transition: all 0.3s ease;
}
.course-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.course-card h3 {
  color: var(--primary-dark);
  margin-bottom: 0.8rem;
}
.course-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.2rem;
}

/* Buttons */
.enroll-btn {
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.enroll-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

/* ==========================
   8. TOOLTIP HOVERS
   ========================== */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60,44,165,0.9);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 90%;
  max-width: 240px;
}
.course-card:hover .tooltip {
  opacity: 1;
}

/* ==========================
   9. MISSION OVERLAY
   ========================== */
.mission-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 2000;
}
.mission-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

.mission-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1500;
}
.mission-overlay.active {
  opacity: 1;
  visibility: visible;
}
.mission-content {
  background: rgba(255,255,255,0.85);
  border-radius: 18px;
  padding: 2.5rem;
  max-width: 700px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.4);
}
.mission-content h3 {
  font-family: var(--font-display);
  margin-bottom: 1rem;
  color: var(--primary-dark);
}
.mission-content p {
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.close-mission {
  background: var(--primary-dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* ==========================
   10. BACK TO TOP BUTTON (FINAL)
   ========================== */
.back-to-top {
  position: fixed !important;
  bottom: 2rem !important;
  left: 2rem !important;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  z-index: 3000;
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.back-to-top::before {
  content: "↑";
  font-size: 1.5rem;
}

/* ==========================
   11. FOOTER
   ========================== */
footer {
  position: relative;
  text-align: center;
  padding: 1.5rem 1rem 1rem;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  font-size: 0.95rem;
  color: var(--text-light);
  border-top: 1px solid rgba(255,255,255,0.4);
}
footer p {
  margin-bottom: 0.5rem;
}

/* ==========================
   12. RESPONSIVE TWEAKS
   ========================== */
@media (max-width: 768px) {
  .logo-title { font-size: 2.4rem; }
  .slogan { font-size: 1rem; }
  .mission-btn {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.9rem;
  }
}
@media (max-width: 480px) {
  .enroll-btn { width: 100%; }
  .course-card { padding: 1.6rem; }
  .mission-content { padding: 1.5rem; }
}
/* ==========================
   TOOLTIP RESTORE & GLOW
   ========================== */
.tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60, 44, 165, 0.9);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  width: 90%;
  max-width: 240px;
  box-shadow: 0 0 12px rgba(120, 100, 255, 0.4);
}
.course-card:hover .tooltip {
  opacity: 1;
}
/* ==========================
   DARK MODE THEME
   ========================== */
body.dark-mode {
  background: radial-gradient(circle at center, #1c1a28 0%, #2b2445 50%, #1a1629 100%);
  color: #e0e0ff;
}
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
  color: #c7baff;
}
body.dark-mode p { color: #d4d4e8; }

body.dark-mode .box,
body.dark-mode .course-card,
body.dark-mode .content-panel,
body.dark-mode .sidebar {
  background: rgba(40, 40, 60, 0.85);
  border-color: rgba(150, 130, 255, 0.4);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

body.dark-mode .enroll-btn {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
  box-shadow: 0 4px 18px rgba(80, 60, 200, 0.5);
}
body.dark-mode .enroll-btn:hover {
  background: linear-gradient(135deg, #7b68ee 0%, #c1b0ff 100%);
}

body.dark-mode .mission-content {
  background: rgba(30, 30, 50, 0.9);
  color: #d0caff;
}

body.dark-mode .mission-btn {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
}

/* Tooltip dark mode */
body.dark-mode .tooltip {
  background: rgba(150, 130, 255, 0.95);
  color: #1a1a1a;
  box-shadow: 0 0 12px rgba(180, 160, 255, 0.5);
}

/* ==========================
   DARK MODE TOGGLE BUTTON
   ========================== */
.dark-toggle-btn {
  position: fixed;
  top: 2rem;
  right: 6rem;
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 2500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
.dark-toggle-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

/* ======================================================
   13. RESPONSIVE LAYOUT — COURSE GRID & PAGE SPACING
   ====================================================== */

/* ---------- Large tablets / small laptops ---------- */
@media (max-width: 1024px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.6rem;
    padding: 0 1rem;
  }

  .landing-container {
    padding: 3rem 1rem 4rem;
  }

  .course-section h2 {
    font-size: 1.8rem;
  }

  .course-card {
    padding: 1.8rem;
  }
}

/* ---------- Tablets & Large Phones ---------- */
@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: 1fr;
    max-width: 90%;
  }

  .course-card {
    margin: 0 auto;
    padding: 1.8rem 1.4rem;
  }

  .logo-title {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
  }

  .slogan {
    font-size: 1rem;
    margin-bottom: 1.8rem;
  }

  .mission-btn,
  .dark-toggle-btn,
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    font-size: 0.85rem;
    width: 50px;
    height: 50px;
  }

  .dark-toggle-btn {
    right: 5rem;
  }
}

/* ---------- Small Phones (<480px) ---------- */
@media (max-width: 480px) {
  .course-section {
    padding: 2.5rem 1rem;
  }

  .course-grid {
    gap: 1.4rem;
    max-width: 95%;
  }

  .course-card {
    padding: 1.5rem;
  }

  .enroll-btn {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .mission-content {
    width: 90%;
    padding: 1.2rem;
  }

  .logo-title {
    font-size: 2rem;
  }

  .tooltip {
    font-size: 0.75rem;
    max-width: 200px;
  }
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 15px rgba(154, 138, 255, 0.7),
              0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ======================================================
   KNOWLEDGE CENTRE — CELLS & CONTROL LAYOUT
   ====================================================== */

/* Hero banner */
.kc-hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  background: radial-gradient(circle at 40% 40%, #ebe6ff 0%, #d8d0ff 70%, #c1b8ff 100%);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.05);
}
.kc-hero h1 {
  font-size: 2.3rem;
  margin-bottom: 0.6rem;
}
.kc-hero p {
  color: var(--text-light);
  margin-bottom: 1.2rem;
}
.kc-hero input {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  width: 260px;
  max-width: 90%;
  box-shadow: 0 0 10px rgba(154,138,255,0.3);
  background: rgba(255,255,255,0.9);
}
.kc-hero input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(154,138,255,0.5);
}

/* Main layout */
.kc-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  max-width: 1200px;
  margin: 2.5rem auto 3rem;
  padding: 0 1rem;
}

/* Panels */
.content-panel {
  flex: 2;
  min-width: 320px;
  background: rgba(255,255,255,0.85);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.5);
}
.sidebar {
  flex: 1;
  min-width: 260px;
  background: rgba(255,255,255,0.65);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.4);
}

/* Wiki text area */
.wiki-text {
  white-space: pre-line;
  line-height: 1.6;
  font-size: 1.05rem;
  color: #111;
  background: rgba(255,255,255,0.8);
  padding: 1.2rem;
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}
.hidden {
  display: none;
}

/* Glossary & Exam items */
.glossary-item,
.exam-item {
  margin-bottom: 0.5rem;
  background: rgba(255,255,255,0.8);
  padding: 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Toggle bar & nav buttons */
.toggle-bar {
  text-align: center;
  margin-bottom: 1.2rem;
}
.toggle-bar button,
.nav-buttons button {
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0.2rem 0.15rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.25s ease;
}
.toggle-bar button:hover,
.nav-buttons button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* ---------- Responsive for Knowledge Centre ---------- */
@media (max-width: 900px) {
  .kc-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .sidebar {
    order: 2;
  }
}

/* ---------- Dark Mode tweaks for KC ---------- */
body.dark-mode .kc-hero {
  background: radial-gradient(circle at 40% 40%, #2b2445 0%, #221c3a 70%, #1a1629 100%);
  box-shadow: inset 0 -2px 8px rgba(0,0,0,0.6);
}
body.dark-mode .kc-hero input {
  background: rgba(30,30,50,0.9);
  color: #e0e0ff;
  border-color: rgba(150,130,255,0.6);
  box-shadow: 0 0 10px rgba(150,130,255,0.5);
}

body.dark-mode .wiki-text,
body.dark-mode .glossary-item,
body.dark-mode .exam-item {
  background: rgba(30,30,50,0.95);
  color: #e0e0ff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

body.dark-mode .toggle-bar button,
body.dark-mode .nav-buttons button {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
}
body.dark-mode .toggle-bar button:hover,
body.dark-mode .nav-buttons button:hover {
  background: linear-gradient(135deg, #7b68ee 0%, #c1b0ff 100%);
}


/* ======================================================
   HEALTH CALCULATORS — STYLES
   ====================================================== */

.calc-hero {
  text-align: center;
  padding: 3.5rem 1rem 3rem;
  background: radial-gradient(circle at center, #ece8ff 0%, #dcd3ff 50%, #b9b0ff 100%);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.08);
}
.calc-hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.6rem;
}
.calc-hero p {
  color: var(--text-light);
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Layout grid */
.calc-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1rem 4rem;
}

/* Calculator cards */
.calc-card {
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 25px rgba(0,0,0,0.18);
  transition: all 0.3s ease;
}
.calc-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 12px 35px rgba(0,0,0,0.25);
}
.calc-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 1.2rem;
  text-align: center;
}

/* Input groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}
.input-group label {
  color: var(--text-light);
  font-size: 0.95rem;
}
.input-group input,
.input-group select {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.9);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(154,138,255,0.4);
}

/* Buttons */
.calc-card button {
  display: block;
  width: 100%;
  margin-top: 0.8rem;
  background: linear-gradient(135deg, #3c2ca5 0%, #8f7aff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  transition: all 0.25s ease;
}
.calc-card button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #2e1f84 0%, #7e68f2 100%);
}

/* Results */
.calc-result {
  margin-top: 0.8rem;
  text-align: center;
  font-weight: 600;
  color: var(--primary-dark);
}
.calc-info {
  margin-top: 1rem;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.5);
  border-radius: 8px;
  padding: 1rem;
}
.calc-info h4 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--primary-dark);
}
.calc-info ul {
  list-style: none;
  padding: 0;
}
.calc-info li {
  margin-bottom: 0.4rem;
}
.safe { color: #2c8a2c; font-weight: 600; }
.good { color: #0077cc; font-weight: 600; }

/* ---------- Dark Mode ---------- */
body.dark-mode .calc-hero {
  background: radial-gradient(circle at center, #1c1a28 0%, #2b2445 50%, #1a1629 100%);
}
body.dark-mode .calc-card {
  background: rgba(40,40,60,0.85);
  border-color: rgba(150,130,255,0.4);
  box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}
body.dark-mode .calc-card h3,
body.dark-mode .calc-info h4 {
  color: #c7baff;
}
body.dark-mode .input-group input,
body.dark-mode .input-group select {
  background: rgba(30,30,50,0.9);
  color: #e0e0ff;
  border-color: rgba(160,140,255,0.3);
}
body.dark-mode .calc-card button {
  background: linear-gradient(135deg, #5a45d0 0%, #a08cff 100%);
}
body.dark-mode .calc-card button:hover {
  background: linear-gradient(135deg, #7b68ee 0%, #c1b0ff 100%);
}
body.dark-mode .calc-info {
  background: rgba(30,30,50,0.9);
  color: #d4d4e8;
}



/* === Glucose Pathway Diagram === */
.diagram-container {
  text-align: center;
  margin: 2.5rem auto;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-width: 820px;
}

.diagram-container svg {
  width: 100%;
  height: auto;
}

.diagram-caption {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Dark mode compatibility */
body.dark-mode .diagram-container {
  background: rgba(40, 40, 60, 0.85);
  border: 1px solid rgba(150, 130, 255, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
body.dark-mode .diagram-caption {
  color: #d4d4e8;
}
