/* ============================================================
   MicroGPT Course — Custom Styles
   Premium dark-first design with teal gradient palette
   ============================================================ */

/* --- Root Variables --- */
:root {
  --md-primary-fg-color: #1de9b6;
  --md-accent-fg-color: #64ffda;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #0d1117;
  --md-default-fg-color: #e6edf3;
  --md-code-bg-color: #161b22;
  --md-typeset-color: #e6edf3;
}

/* --- Typography --- */
.md-typeset {
  font-size: 0.85rem;
  line-height: 1.75;
}

.md-typeset h1 {
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1de9b6 0%, #64ffda 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.md-typeset h2 {
  font-weight: 700;
  border-bottom: 2px solid rgba(29, 233, 182, 0.25);
  padding-bottom: 0.4em;
  margin-top: 2em;
}

.md-typeset h3 {
  font-weight: 600;
  color: var(--md-accent-fg-color);
}

/* --- Code Blocks --- */
.md-typeset pre > code {
  font-size: 0.82rem;
  line-height: 1.6;
  border-radius: 8px;
}

.md-typeset code {
  border-radius: 4px;
  padding: 0.15em 0.4em;
}

/* Code block titles */
.md-typeset .highlight > .filename {
  background: linear-gradient(135deg, rgba(29, 233, 182, 0.15), rgba(100, 255, 218, 0.08));
  border-bottom: 1px solid rgba(29, 233, 182, 0.3);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --- Admonitions — Premium Feel --- */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border-left-width: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
}

/* Custom "intuition" admonition — lighter teal for mental models */
.md-typeset .admonition.intuition,
.md-typeset details.intuition {
  border-color: #64ffda;
}
.md-typeset .intuition > .admonition-title,
.md-typeset .intuition > summary {
  background-color: rgba(100, 255, 218, 0.1);
}
.md-typeset .intuition > .admonition-title::before,
.md-typeset .intuition > summary::before {
  background-color: #64ffda;
  -webkit-mask-image: var(--md-admonition-icon--tip);
  mask-image: var(--md-admonition-icon--tip);
}

/* --- Math Blocks --- */
.md-typeset .katex-display {
  padding: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.md-typeset .katex {
  font-size: 1.15em;
}

/* --- Tables --- */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.md-typeset table:not([class]) th {
  background: linear-gradient(135deg, rgba(29, 233, 182, 0.15), rgba(100, 255, 218, 0.08));
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* --- Tabs --- */
.md-typeset .tabbed-labels > label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --- Mermaid --- */
.mermaid {
  margin: 1.5em 0;
  overflow-x: auto;
  font-size: 0.95rem;
}

/* Prevent Mermaid from shrinking too small on mobile */
.mermaid svg {
  min-width: 500px;
  max-width: 100%;
  height: auto;
}

/* --- Navigation --- */
.md-nav__link {
  font-size: 0.82rem;
}

/* Module numbers in nav */
.md-nav__item .md-nav__link {
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.md-nav__item .md-nav__link:hover {
  padding-left: 4px;
}

/* --- Footer Navigation (Prev/Next) --- */
.md-footer-nav__link {
  transition: transform 0.2s ease;
}

.md-footer-nav__link:hover {
  transform: translateY(-2px);
}

/* --- Smooth scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Hero section on index page --- */
.hero {
  text-align: center;
  padding: 2em 0 3em;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5em;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: rgba(230, 237, 243, 0.7);
  max-width: 600px;
  margin: 0 auto 1.5em;
  line-height: 1.6;
}

[data-md-color-scheme="default"] .hero .subtitle {
  color: rgba(0, 0, 0, 0.6);
}

/* Module cards grid */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1em;
  margin: 2em 0;
}

.module-card {
  border: 1px solid rgba(29, 233, 182, 0.2);
  border-radius: 12px;
  padding: 1.5em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: rgba(29, 233, 182, 0.03);
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(29, 233, 182, 0.15);
  border-color: rgba(29, 233, 182, 0.5);
}

.module-card h3 {
  margin-top: 0;
  font-size: 1rem;
}

.module-card p {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 0;
}

/* --- Terminology collapsible default closed --- */
.md-typeset details.terminology {
  border-color: rgba(29, 233, 182, 0.4);
}

/* --- Blockquote styling --- */
.md-typeset blockquote {
  border-left: 4px solid var(--md-accent-fg-color);
  background: rgba(29, 233, 182, 0.05);
  border-radius: 0 8px 8px 0;
  padding: 0.8em 1.2em;
}
