/* ============================================================
   Senior Engineer Academy — Custom Styles
   ============================================================ */

/* Site-wide polish (shared across learn-ml / AIEngineering / interview-prep) */
.md-header {
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.2);
}

.md-header__title {
  font-weight: 700;
  letter-spacing: -0.015em;
}

.md-tabs__link {
  font-weight: 600;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  letter-spacing: -0.025em;
}

.md-typeset h2 {
  margin-top: 3.2rem;
  font-weight: 750;
}

/* Landing page hero (shared component pattern, ported from AIEngineering) */
:root {
  --course-navy: #0b1220;
  --course-accent: #0d9488;
  --course-accent-light: #2dd4bf;
  --course-line: rgba(148, 163, 184, 0.28);
}

.md-content:has(.course-hero) .md-content__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding-top: 1.5rem;
}

.course-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  margin: 0 -1rem;
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 4rem);
  overflow: hidden;
}

.course-hero::before {
  content: "";
  position: absolute;
  width: 30rem;
  height: 30rem;
  right: -12rem;
  top: -14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent 68%);
  pointer-events: none;
}

.course-eyebrow {
  display: inline-block;
  color: var(--course-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.course-hero h1 {
  max-width: 15ch;
  margin: 0.8rem 0 1.2rem;
  color: var(--course-navy);
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.course-hero h1 span {
  color: var(--course-accent);
}

.course-hero__lead {
  max-width: 38rem;
  margin: 0;
  color: #475569;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.md-typeset .course-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.8rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.md-typeset .course-button:hover {
  transform: translateY(-1px);
}

.md-typeset .course-button--primary {
  background: var(--course-accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.28);
}

.md-typeset .course-button--secondary {
  border-color: #cbd5e1;
  background: rgba(255, 255, 255, 0.7);
  color: #1e293b;
}

.md-typeset .course-button--coffee {
  border-color: #ffdd00;
  background: #ffdd00;
  color: #0b1220;
  box-shadow: 0 8px 24px rgba(255, 221, 0, 0.28);
}

.md-typeset .course-button--coffee:hover {
  background: #ffe94d;
  border-color: #ffe94d;
}

.course-hero__note {
  margin: 1rem 0 0;
  color: #64748b;
  font-size: 0.72rem;
}

.course-terminal {
  position: relative;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 0.85rem;
  background: #101827;
  color: #ccfbf1;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  overflow: hidden;
  transform: perspective(1000px) rotateY(-2deg) rotateX(1deg);
}

.course-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  background: #0b1220;
}

.course-terminal__bar i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #fb7185;
}

.course-terminal__bar i:nth-child(2) { background: #fbbf24; }
.course-terminal__bar i:nth-child(3) { background: #34d399; }
.course-terminal__bar span { margin-left: 0.4rem; color: #64748b; }
.course-terminal__body { padding: 1rem 1.1rem 1.2rem; }
.course-terminal__body p { margin: 0.7rem 0; }
.terminal-muted { margin-right: 0.65rem; color: var(--course-accent-light); }
.terminal-status { margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid rgba(148, 163, 184, 0.14); color: #94a3b8; }
.terminal-status span { display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.4rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1); }

.course-proof {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 3rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--course-line);
  border-bottom: 1px solid var(--course-line);
}

.course-proof > div { padding: 0.2rem 1.2rem; border-right: 1px solid var(--course-line); text-align: center; }
.course-proof > div:last-child { border-right: 0; }
.course-proof strong { display: block; color: var(--course-navy); font-size: 1.25rem; }
.course-proof span { display: block; margin-top: 0.12rem; color: #64748b; font-size: 0.68rem; }

[data-md-color-scheme="slate"] .course-hero h1,
[data-md-color-scheme="slate"] .course-proof strong { color: #f8fafc; }
[data-md-color-scheme="slate"] .course-hero__lead { color: #94a3b8; }
[data-md-color-scheme="slate"] .course-button--secondary { border-color: #475569; background: rgba(15, 23, 42, 0.5); color: #e2e8f0; }

@media (max-width: 1100px) {
  .course-hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .course-hero h1 { max-width: none; }
  .course-terminal { max-width: 34rem; transform: none; }
}

@media (max-width: 800px) {
  .course-proof { grid-template-columns: repeat(2, 1fr); }
  .course-proof > div:nth-child(2) { border-right: 0; }
  .course-proof > div:nth-child(-n+2) { padding-bottom: 0.9rem; }
  .course-proof > div:nth-child(n+3) { padding-top: 0.9rem; border-top: 1px solid var(--course-line); }
}

@media (max-width: 560px) {
  .course-hero h1 { font-size: 2.2rem; }
  .course-actions { flex-direction: column; }
  .course-actions .course-button { width: 100%; }
}

:root {
  --academy-primary: #3f51b5;
  --academy-accent: #5c6bc0;
  --academy-success: #43a047;
  --academy-warning: #fb8c00;
  --academy-danger: #e53935;
  --sim-bg: #1a1a2e;
  --sim-node: #4a90d9;
  --sim-edge: #6c757d;
}

/* ── Simulation containers ── */
.sim-container {
  background: var(--sim-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
}

.sim-title {
  font-size: 1rem;
  font-weight: 700;
  color: #90caf9;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.sim-btn {
  background: #2a2a4a;
  border: 1px solid #4a4a8a;
  border-radius: 6px;
  color: #90caf9;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  transition: all 0.2s;
}
.sim-btn:hover { background: #3a3a6a; border-color: #7a7aba; }
.sim-btn.danger { border-color: #c62828; color: #ef9a9a; }
.sim-btn.danger:hover { background: #2a1a1a; }
.sim-btn.success { border-color: #2e7d32; color: #a5d6a7; }
.sim-btn.success:hover { background: #1a2a1a; }

.sim-canvas {
  width: 100%;
  min-height: 220px;
  background: #111122;
  border-radius: 8px;
  border: 1px solid #333355;
  position: relative;
  overflow: hidden;
}

.sim-log {
  background: #0d0d1a;
  border: 1px solid #333355;
  border-radius: 6px;
  font-size: 0.78rem;
  height: 120px;
  margin-top: 0.75rem;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}
.sim-log .log-ok   { color: #a5d6a7; }
.sim-log .log-warn { color: #ffe082; }
.sim-log .log-err  { color: #ef9a9a; }
.sim-log .log-info { color: #90caf9; }

.sim-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
}

.sim-stat {
  background: #111133;
  border: 1px solid #333366;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  min-width: 110px;
}
.sim-stat-label { color: #9e9ec8; font-size: 0.7rem; text-transform: uppercase; }
.sim-stat-value { color: #e0e0ff; font-size: 1.3rem; font-weight: 700; }

/* ── Capacity calculator inputs ── */
.cap-grid label {
  color: #b0b0d8;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cap-grid input {
  background: #111133;
  border: 1px solid #444477;
  border-radius: 6px;
  color: #e0e0ff;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
  width: 100%;
}

/* ── Slider inputs ── */
.sim-slider-row {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
.sim-slider-row label { color: #b0b0d8; font-size: 0.8rem; min-width: 140px; }
.sim-slider-row input[type=range] { flex: 1; }
.sim-slider-row .val { color: #90caf9; min-width: 50px; text-align: right; font-size: 0.8rem; }

/* ── DSA visualizer ── */
.dsa-array {
  display: flex;
  gap: 4px;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.dsa-cell {
  align-items: center;
  background: #1e1e3a;
  border: 2px solid #3a3a6a;
  border-radius: 6px;
  color: #e0e0ff;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  height: 48px;
  justify-content: center;
  transition: all 0.3s;
  width: 48px;
}
.dsa-cell.active   { background: #1565c0; border-color: #42a5f5; color: #fff; }
.dsa-cell.window   { background: #1b5e20; border-color: #66bb6a; color: #fff; }
.dsa-cell.visited  { background: #4a148c; border-color: #ce93d8; color: #fff; }
.dsa-cell.current  { background: #e65100; border-color: #ffb74d; color: #fff; }
.dsa-cell.optimal  { background: #1a237e; border-color: #7986cb; color: #fff; }

.dsa-pointer {
  color: #ff8a65;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 2px;
}

/* ── Graph node viz ── */
.graph-canvas {
  background: #111122;
  border: 1px solid #333355;
  border-radius: 8px;
  height: 300px;
  position: relative;
  width: 100%;
}

.graph-node {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 0.8rem;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: all 0.3s;
  width: 44px;
  user-select: none;
}
.graph-node.unvisited  { background: #37474f; border: 2px solid #78909c; }
.graph-node.queued     { background: #f57f17; border: 2px solid #ffee58; }
.graph-node.visited    { background: #1565c0; border: 2px solid #42a5f5; }
.graph-node.current    { background: #b71c1c; border: 2px solid #ef5350; box-shadow: 0 0 12px #ef5350; }
.graph-node.path       { background: #1b5e20; border: 2px solid #66bb6a; }

/* ── Admonition extras ── */
.md-typeset .admonition.staff {
  border-left-color: #ff8f00;
}
.md-typeset .admonition.staff > .admonition-title {
  background: rgba(255, 143, 0, 0.1);
}
.md-typeset .admonition.staff > .admonition-title::before {
  background-color: #ff8f00;
}

/* ── Trade-off table ── */
.tradeoff-table {
  border-collapse: collapse;
  font-size: 0.88rem;
  width: 100%;
}
.tradeoff-table th {
  background: var(--md-primary-fg-color);
  color: #fff;
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.tradeoff-table td {
  border: 1px solid var(--md-typeset-table-color);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}
.tradeoff-table .good  { color: var(--academy-success); font-weight: 600; }
.tradeoff-table .bad   { color: var(--academy-danger);  font-weight: 600; }
.tradeoff-table .med   { color: var(--academy-warning); font-weight: 600; }

/* ── Progress checklist ── */
.checklist-item {
  align-items: flex-start;
  display: flex;
  gap: 0.5rem;
  margin: 0.4rem 0;
}
.checklist-item input[type=checkbox] { margin-top: 0.2rem; }

/* ── Calculator / form controls inside sims ── */
.sim-container input[type="number"],
.sim-container input[type="text"],
.sim-container select {
  background: #111133;
  border: 1px solid #444477;
  border-radius: 4px;
  color: #e0e0ff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  width: 100%;
}
.sim-container label {
  color: #b0b0d8;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.sim-explain { color: #9e9ec8; font-size: 0.82rem; margin-top: 0.75rem; line-height: 1.45; }
.cap-flag {
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 0.35rem 0;
  padding: 0.4rem 0.7rem;
}
.cap-flag.warn { background: #3e2723; color: #ffcc80; border: 1px solid #ef6c00; }
.cap-flag.ok { background: #1b3a1b; color: #a5d6a7; border: 1px solid #2e7d32; }

/* ── Status chips ── */
.status-complete { color: var(--academy-success); font-weight: 600; }
.status-wip { color: var(--academy-warning); font-weight: 600; }
.status-planned { color: #9e9ec8; }

/* ── Progress tracking & dashboard ── */
.progress-mark-bar {
  margin: 1rem 0 1.5rem;
}

.progress-bar {
  background: #111133;
  border: 1px solid #333366;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 0.5rem 0 1rem;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--academy-primary), var(--academy-accent));
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-section-row { margin-bottom: 1rem; }
.progress-section-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9e9ec8;
  margin-bottom: 0.3rem;
}
.progress-section-label span { color: #e0e0ff; font-weight: 600; }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1.5rem;
}

.badge {
  background: #111133;
  border: 1px solid #333366;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.badge.earned { border-color: #7a7aba; background: #1a1a3a; }
.badge.locked { opacity: 0.5; }
.badge-icon { font-size: 1.4rem; margin-bottom: 0.25rem; }
.badge-label { color: #e0e0ff; font-size: 0.85rem; font-weight: 700; }
.badge-desc { color: #9e9ec8; font-size: 0.7rem; margin-top: 0.2rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sim-container { padding: 1rem; }
  .dsa-cell { height: 40px; width: 40px; font-size: 0.9rem; }
  .sim-stat { min-width: 88px; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
