/* =====================
   THEME VARIABLES
===================== */
:root {
  --bg: #020617;
  --card: rgba(15, 23, 42, 0.8);
  --text: #e5e7eb;
  --muted: #94a3b8;

  --primary: #38bdf8;
  --secondary: #60a5fa;
  --subtopic: #22d3ee;

  --border: rgba(255,255,255,0.08);
}

body.light {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;

  --primary: #1d4ed8;
  --secondary: #2563eb;
  --subtopic: #0284c7;

  --border: #e5e7eb;
}

/* =====================
   BASE
===================== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

/* =====================
   THEME TOGGLE
===================== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  z-index: 100;
}

/* =====================
   HEADER
===================== */
.topic-header {
  text-align: center;
  padding: 4rem 2rem 2rem;
}

.topic-header h1 {
  font-size: 2.6rem;
  margin: 0;
  color: var(--primary);
}

.subtitle {
  color: var(--secondary);
  margin-top: 0.5rem;
}

/* =====================
   CONTENT
===================== */
.content-wrapper {
  max-width: 900px;
  margin: auto;
  padding: 3rem 2rem;
}

.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  color: var(--primary);
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.content-section p {
  color: var(--muted);
}

/* =====================
   INFO CARDS
===================== */
.info-card {
  background: var(--card);
  padding: 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-top: 1.2rem;
}

.info-card h3 {
  margin-top: 0;
  color: var(--subtopic);
}

/* =====================
   IMAGE
===================== */
.image-heading {
  color: var(--secondary);
}

.content-image {
  width: 50%;
  margin: 1rem auto 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: block;
}

/* =====================
   TABLES
===================== */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.2rem;
  border: 1px solid var(--border);
}

thead {
  background: rgba(56, 189, 248, 0.1);
}

th {
  padding: 0.8rem 1.2rem;
  text-align: left;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.8rem 1.2rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* =====================
   BOTTOM NAV
===================== */
.bottom-nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  
  /* Positions the buttons over the content */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  
  /* Removes background and border */
  background: transparent; 
  border: none;
  
  /* Ensures it stays above all content */
  z-index: 1000;
  pointer-events: none; /* Allows clicking "through" the empty space to content behind it */
}

.bottom-nav a {
  text-decoration: none;
  color: #ffffff; /* Contrast color for text */
  background-color: var(--primary);
  padding: 0.8rem 1.5rem;
  border-radius: 50px; /* Rounded pill shape for a modern button look */
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Adds depth so they stand out */
  
  /* Re-enables clicking for the buttons specifically */
  pointer-events: auto; 
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.bottom-nav a:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
/* =====================
   QUIZ BUTTONS
===================== */

/* Common button base */
.btn-primary,
.btn-secondary {
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
  user-select: none;
}

/* =====================
   SUBMIT BUTTON
===================== */
.btn-primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(34, 197, 94, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* =====================
   RESET BUTTON
===================== */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-secondary:active {
  background: rgba(239, 68, 68, 0.15);
}

/* =====================
   MOBILE FRIENDLY
===================== */
@media (max-width: 480px) {
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}
