:root {
  --bg-color: #f5f5f7;
  --text-color: #1d1d1f;
  --border-color: #d2d2d7;
  --box-bg: #ffffff;
  --box-hover: #f5f5f7;
  --desc-text: #515154;
  --link-color: #0A84FF;
  --link-hover: #005bb5;
  --legacy-link: #515154;
  --legacy-hover: #1d1d1f;
  --img-placeholder: #e5e5ea;

  --nav-bg: #0f1346;
  --nav-text: #ffffff;
}

:root[data-theme="dark"] {
  /* Main Site Colors */
  --bg-color: #121212;
  --text-color: #ffffff;
  --border-color: #333333;
  --box-bg: #1c1c1e;
  --box-hover: #2c2c2e;
  --desc-text: #a1a1a6;
  --link-color: #2140f0;
  --link-hover: #6a1fcc;
  --legacy-link: #a1a1a6;
  --legacy-hover: #ffffff;
  --img-placeholder: #3a3a3c;

  --nav-bg: #225cad;
  --nav-text: #ffffff;
}


body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color); 
  color: var(--text-color);
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease; /* Smooth fade when toggling */
}

/* --- NAVIGATION BAR --- */
.top-nav {
  width: 100%;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between; 
  align-items: center;
  padding: 1rem 5%; 
  box-sizing: border-box;
  position: sticky; 
  top: 0;
  z-index: 1000; 
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: lighter;
  color: var(--nav-text);
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 400;
  transition: opacity 0.2s;
}

.nav-links a:hover {
  opacity: 0.7;
}

/* --- THEME DROPDOWN STYLING --- */
.theme-dropdown {
  background-color: transparent;
  color: var(--nav-text);
  border: 1px solid var(--nav-text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s ease, border-color 0.2s ease, color 0.3s ease, opacity 0.2s;
  font-family: inherit;
}

.theme-dropdown:hover {
  opacity: 0.7;
}

/* Fix for dropdown options looking invisible on some OS browsers */
.theme-dropdown option {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* CATEGORY LANDING PAGE */
    .main {
      min-height: 100vh;
      transition: background-color 0.3s ease, color 0.3s ease;
      display: flex;
      justify-content: center;
      padding: 0 20px; /* for mobile */
    }

    .container {
      width: 100%;
      max-width: 800px;
      display: flex;
      flex-direction: column;
      gap: 50px;
      margin-top: 100px;
      margin-bottom: 100px;
    }

    .page-title {
      font-size: 3rem;
      font-weight: bold;
      margin-bottom: 10px;
      color: var(--text-main);
    }

    .exercise {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .exercise h2 {
      margin: 0;
      color: var(--text-main);
      border-bottom: 2px solid #eaeaea;
      padding-bottom: 10px;
    }

    .card {
      width: 100%;
      max-width: 600px;
      min-height: 6rem;
      height: auto;
      display: flex;
      align-items: stretch;
      gap: 20px;
      background: var(--box-bg);
      border-radius: 8px;
      padding-right: 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.06); 
      border: 1px solid #eaeaea;
      transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
      border-radius: 8px;
    }

    .card:hover {
      opacity: 0.9;
      transform: translateY(-3px);
      box-shadow: 0 6px 12px rgba(0,0,0,0.1);
      cursor: pointer;
    }

    .icon-box {
      min-width: 64px;
      border-radius: 6px;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-shrink: 0;
    }

    .icon-box svg {
      width: 24px;
      height: 24px;
      stroke: #ffffff;
      stroke-width: 1.5;
      stroke-linecap: round;
      stroke-linejoin: round;
      fill: none;
    }

    .text-content {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .text-content h3 {
      margin: 0 0 6px 0;
      font-size: 1.15rem;
      color: var(--text-main);
      font-weight: 600;
    }

    .text-content p {
      margin: 0;
      font-size: 0.95rem;
      color: var(--text-muted);
      line-height: 1.5;
    }

    .reading-section {
      background: var(--box-bg);
      padding: 30px;
      border-radius: 8px;
      border: 1px solid #eaeaea;
      box-shadow: 0 2px 8px rgba(0,0,0,0.03);
      margin-top: 20px;
    }

    .reading-section h3 {
      color: var(--text-main);
      margin-top: 1.5em;
      margin-bottom: 0.5em;
    }
    
    .reading-section h3:first-child {
      margin-top: 0;
    }

    p {
      font-size: 1.1rem;
      line-height: 1.6em;
      color: var(--text-color);
      margin-bottom: 1em;
    }

    /* adjustment for mobile */
    @media (max-width: 600px) {
      .card {
        flex-direction: column;
        text-align: center;
      }
      .icon-box {
        padding: 20px 0;
      }
      .reading-section {
        padding: 20px;
      }
    }

 .icon-box svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  overflow: visible;
}

