/* Custom enhancements layered on top of Tabler */
:root {
  color-scheme: light;
  --accent: #206bc4;
  --accent-soft: rgba(32, 107, 196, 0.12);
  --surface-soft: #f6f8fb;
  --text-muted: #66799e;
}

/* Enhanced Tabler Cards */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link-pop:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075) !important;
}

/* Better Avatar Styling */
.avatar {
  transition: transform 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

/* Enhanced Badges */
.badge-lg {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Highlight/Code Blocks */
.highlight {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
}

.highlight pre {
  margin: 0;
  background: transparent;
  border: none;
  padding: 0;
}

/* Better Spacing for Icons in Text */
.ti {
  vertical-align: middle;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 52rem;
}

.lesson-meta .badge code {
  background: rgba(32, 107, 196, 0.18);
  color: inherit;
  padding: 0.05rem 0.3rem;
}

.lesson-shell {
  display: grid;
  gap: 2rem;
}

.lesson-surface {
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 60px rgba(32, 44, 64, 0.18);
  padding: clamp(1.75rem, 3vw, 2.75rem);
}

.lesson-section {
  margin-bottom: 2.25rem;
}

.lesson-section:last-child {
  margin-bottom: 0;
}

.lesson-section h1,
.lesson-section h2,
.lesson-section h3,
.lesson-section h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.lesson-section h1:first-child,
.lesson-section h2:first-child,
.lesson-section h3:first-child,
.lesson-section h4:first-child,
.lesson-section h1 + p:first-of-type {
  margin-top: 0;
}

.lesson-section p {
  margin-bottom: 1rem;
}

.lesson-section ul,
.lesson-section ol {
  margin: 1rem 0;
  padding-left: 1.2rem;
}

.lesson-section li + li {
  margin-top: 0.45rem;
}

code {
  font-family: "Fira Code", "SFMono-Regular", Menlo, monospace;
  background: rgba(32, 107, 196, 0.15);
  color: #1f2937;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.95em;
}

pre {
  font-family: "Fira Code", "SFMono-Regular", Menlo, monospace;
  background: #ffffff;
  border: 1px solid rgba(32, 107, 196, 0.18);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: #0f172a;
  margin: 1.5rem 0;
}

blockquote p {
  margin-bottom: 0;
}

.callout {
  border: 1px solid rgba(32, 107, 196, 0.25);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
}

.lesson-nav-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.lesson-nav-card {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(210deg, rgba(32, 107, 196, 0.88), rgba(91, 191, 255, 0.78));
  color: #fff;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
  min-width: 280px;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  box-shadow: 0 24px 45px rgba(19, 35, 64, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lesson-nav-card::after {
  content: '';
  position: absolute;
  inset: 18px 18px auto auto;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
  opacity: 0.85;
}

.lesson-nav-card:hover,
.lesson-nav-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 32px 60px rgba(19, 35, 64, 0.28);
}

.lesson-nav-card h3 {
  font-size: 1.35rem;
  margin: 0;
  line-height: 1.2;
}

.lesson-nav-card p {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.87);
}

.lesson-nav-card .btn {
  align-self: flex-start;
  margin-top: auto;
  border-radius: 999px;
  padding-inline: 1.1rem;
  font-weight: 600;
}

.lesson-subnav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem;
  border-radius: 18px;
  background: rgba(32, 107, 196, 0.08);
  border: 1px solid rgba(32, 107, 196, 0.18);
}

.lesson-subnav a {
  color: #206bc4;
  font-weight: 600;
  text-decoration: none;
}

.lesson-subnav a:hover,
.lesson-subnav a:focus {
  text-decoration: underline;
}

.lesson-stage-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lesson-stage-card {
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 1.4rem 1.6rem;
  background: #f8fafc;
  box-shadow: 0 16px 34px rgba(15, 38, 68, 0.12);
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lesson-stage-card h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.lesson-stage-card p {
  margin: 0;
  color: var(--text-muted);
}

.lesson-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 38, 68, 0.1);
}

.lesson-table thead {
  background: rgba(32, 107, 196, 0.12);
  color: #0f172a;
}

.lesson-table th,
.lesson-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  vertical-align: top;
}

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

.footer-note {
  border-top: 1px solid rgba(100, 116, 139, 0.18);
  padding-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-card .quiz-header .quiz-title {
  color: #0f172a;
}

.quiz-card .quiz-header .quiz-prompt {
  color: var(--text-muted);
}

.quiz-card .quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: var(--surface-soft);
}

.quiz-card .quiz-option input {
  margin-top: 0.35rem;
}

.quiz-card .quiz-option label {
  cursor: pointer;
  display: grid;
  gap: 0.35rem;
}

.quiz-card .quiz-option small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.quiz-card--correct {
  border-color: #2fb344;
  box-shadow: 0 10px 24px rgba(47, 179, 68, 0.18);
}

.quiz-card--correct .quiz-option[data-correct='true'] {
  border-color: #2fb344;
  background: rgba(47, 179, 68, 0.14);
}

.quiz-card--incorrect {
  border-color: #d63939;
  box-shadow: 0 10px 24px rgba(214, 57, 57, 0.16);
}

.quiz-feedback {
  font-weight: 600;
}

.quiz-card.quiz-error {
  border: 1px solid rgba(247, 103, 7, 0.4);
  background: rgba(247, 103, 7, 0.16);
  color: #7f3b02;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

[hidden] {
  display: none !important;
}
