/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


/* ============================================================
   CSS VARIABLES — Light & Dark themes
   ============================================================ */
:root {
  --byui-blue:       #006EB6;
  --byui-blue-dark:  #00528a;
  --accent:          #4a90e2;
  --accent-hover:    #2f6fc4;

  --bg-primary:      #ffffff;
  --bg-secondary:    #f4f7fb;
  --bg-card:         #ffffff;
  --border-color:    #dde3ed;

  --text-primary:    #1a1f2e;
  --text-secondary:  #4a5568;
  --text-muted:      #718096;

  --week-1:          #006EB6;
  --week-2:          #38a169;
  --week-3:          #d69e2e;
  --week-4:          #9f7aea;
  --project-color:   #e53e3e;

  --shadow-sm:       0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:       0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:       0 8px 24px rgba(0,0,0,0.13);
  --radius:          10px;
  --transition:      0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:    #0f1117;
    --bg-secondary:  #1a1f2e;
    --bg-card:       #1e2436;
    --border-color:  #2d3550;

    --text-primary:  #e8eaf0;
    --text-secondary:#a0aec0;
    --text-muted:    #718096;

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg:     0 8px 24px rgba(0,0,0,0.5);
  }
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}


/* ============================================================
   FROSTED GLASS NAVBAR
   ============================================================ */
.navbar {
  background-color: rgba(0, 110, 182, 0.82) !important;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color var(--transition);
}

@media (prefers-color-scheme: dark) {
  .navbar {
    background-color: rgba(10, 20, 40, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
}

/* Logo */
.navbar-brand img,
.navbar-logo img {
  height: 52px;
  max-height: 64px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

@media (min-width: 992px) {
  .navbar-brand img,
  .navbar-logo img {
    height: 64px;
  }
}

/* Nav links */
.navbar .nav-link {
  color: rgba(255,255,255,0.92) !important;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.4rem 0.85rem !important;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  background: rgba(255,255,255,0.15);
  color: #ffffff !important;
}

/* Dropdown */
.dropdown-menu {
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem 0;
}

.dropdown-item {
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
  color: var(--byui-blue);
}

/* Section dividers inside dropdowns */
.dropdown-divider {
  border-color: var(--border-color);
  margin: 0.3rem 0;
}

/* Non-link week labels inside dropdowns */
.dropdown-header {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem 0.2rem;
}


/* ============================================================
   CARD-STYLE LESSON TILES
   Apply .lesson-grid + .lesson-card in your .qmd files,
   or the table below auto-styles the schedule table
   ============================================================ */

/* Auto-style the Daily Schedule table as cards */
.schedule-table table,
table.schedule {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  margin-top: 1rem;
}

.schedule-table table thead th,
table.schedule thead th {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25rem 1rem;
  border: none;
}

.schedule-table table tbody tr,
table.schedule tbody tr {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.schedule-table table tbody tr:hover,
table.schedule tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.schedule-table table tbody td,
table.schedule tbody td {
  padding: 0.75rem 1rem;
  border: none;
  vertical-align: middle;
}

.schedule-table table tbody td:first-child,
table.schedule tbody td:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
  font-weight: 600;
  color: var(--byui-blue);
}

.schedule-table table tbody td:last-child,
table.schedule tbody td:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Week badge pill */
.week-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.03em;
}

.week-1 { background-color: var(--week-1); }
.week-2 { background-color: var(--week-2); }
.week-3 { background-color: var(--week-3); }
.week-4 { background-color: var(--week-4); }
.week-project { background-color: var(--project-color); }


/* ============================================================
   LESSON CARD GRID  (optional: use in overview pages)
   Usage in .qmd:
     ::: {.lesson-grid}
     ::: {.lesson-card .week-1-card}
     ### Day 1
     APIs & Your First LLM Call
     :::
     :::
   ============================================================ */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 1.5rem 0;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--byui-blue);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.lesson-card h3, .lesson-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}

.lesson-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.week-1-card  { border-left-color: var(--week-1); }
.week-2-card  { border-left-color: var(--week-2); }
.week-3-card  { border-left-color: var(--week-3); }
.week-4-card  { border-left-color: var(--week-4); }
.project-card { border-left-color: var(--project-color); }


/* ============================================================
   CALLOUT ENHANCEMENTS
   ============================================================ */
.callout {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.callout-tip    { border-left-color: var(--week-2) !important; }
.callout-note   { border-left-color: var(--byui-blue) !important; }
.callout-warning{ border-left-color: var(--week-3) !important; }
.callout-important { border-left-color: var(--project-color) !important; }

/* Ensure callout body text is always readable regardless of theme */
.callout .callout-body,
.callout .callout-body p,
.callout .callout-body li,
.callout .callout-body ul,
.callout .callout-body ol,
.callout .callout-body code {
  color: var(--text-primary) !important;
}

/* Callout header row — Quarto gives it a tinted background;
   force the title text and icon to always be readable on it */
.callout .callout-header,
.callout-header {
  background-color: transparent !important;
}

.callout .callout-title,
.callout .callout-title p,
.callout-header .callout-title-container,
.callout-header .callout-title-container p {
  color: var(--text-primary) !important;
  font-weight: 700;
}

/* The coloured header strip Quarto injects via .callout-style-default */
div.callout-note.callout > .callout-header,
div.callout-tip.callout > .callout-header,
div.callout-warning.callout > .callout-header,
div.callout-important.callout > .callout-header,
div.callout-caution.callout > .callout-header {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

div.callout-note.callout > .callout-header .callout-title-container,
div.callout-tip.callout > .callout-header .callout-title-container,
div.callout-warning.callout > .callout-header .callout-title-container,
div.callout-important.callout > .callout-header .callout-title-container,
div.callout-caution.callout > .callout-header .callout-title-container {
  color: var(--text-primary) !important;
}

/* Force readable backgrounds on all callout types —
   Quarto's Cosmo theme sometimes uses a tinted bg that
   blends with the text colour in dark mode */
.callout-note {
  background-color: color-mix(in srgb, var(--byui-blue) 8%, var(--bg-card)) !important;
}
.callout-tip {
  background-color: color-mix(in srgb, var(--week-2) 8%, var(--bg-card)) !important;
}
.callout-warning {
  background-color: color-mix(in srgb, var(--week-3) 8%, var(--bg-card)) !important;
}
.callout-important {
  background-color: color-mix(in srgb, var(--project-color) 8%, var(--bg-card)) !important;
}

/* Icon colours to match each callout type */
.callout-note    .callout-icon::before { color: var(--byui-blue)      !important; }
.callout-tip     .callout-icon::before { color: var(--week-2)         !important; }
.callout-warning .callout-icon::before { color: var(--week-3)         !important; }
.callout-important .callout-icon::before { color: var(--project-color)!important; }


/* ============================================================
   CODE BLOCKS
   ============================================================ */
pre, code {
  border-radius: 7px;
  font-size: 0.88em;
}

pre {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
  padding: 1rem 1.2rem;
}

@media (prefers-color-scheme: dark) {
  pre {
    background-color: #141824 !important;
    border-color: #2d3550;
  }
}

/* Copy button */
.code-copy-button {
  opacity: 0.5;
  transition: opacity var(--transition);
}
.code-copy-button:hover { opacity: 1; }


/* ============================================================
   CONTENT AREA
   ============================================================ */
.quarto-container, #quarto-content {
  background-color: var(--bg-primary);
}

/* TOC sidebar */
#quarto-sidebar, nav[role="doc-toc"] {
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

nav[role="doc-toc"] a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

nav[role="doc-toc"] a:hover,
nav[role="doc-toc"] a.active {
  color: var(--byui-blue);
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
}

h2 {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.35rem;
  margin-top: 2rem;
}

/* Links */
a {
  color: var(--byui-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent-hover); text-decoration: underline; }


/* ============================================================
   FOOTER
   ============================================================ */
.nav-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}


/* ============================================================
   SMOOTH SCROLL
   ============================================================ */
html { scroll-behavior: smooth; }