/* Overhauled Spacious Design System for Pediatric OSCE Knowledge Base */

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(6, 9, 17, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.6);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.9);
}

/* Tab Transitions */
.tab-content {
  animation: tabFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Markdown Rendering Canvas & Tables */
.markdown-body {
  color: #e2e8f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.8;
  font-size: 0.925rem;
}

.markdown-body h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  letter-spacing: -0.02em;
}

.markdown-body h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 6rem;
}

.markdown-body h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.markdown-body hr {
  border-color: rgba(51, 65, 85, 0.4);
  margin: 2.5rem 0;
}

/* Table Design conforming to Rules.md with Comfortable Row Spacing */
.markdown-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0 2.5rem 0;
  font-size: 0.875rem;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.markdown-body th {
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  font-weight: 700;
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.markdown-body td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.7);
  vertical-align: top;
  line-height: 1.7;
}

.markdown-body tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:hover td {
  background: rgba(30, 41, 59, 0.35);
}

/* Callouts & Alert Boxes */
.markdown-body blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.08);
  border-radius: 0 1rem 1rem 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.markdown-body blockquote p {
  margin: 0;
}

.markdown-body strong {
  color: #ffffff;
  font-weight: 700;
}

.markdown-body code {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.6);
  padding: 0.15rem 0.45rem;
  border-radius: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.825rem;
  color: #38bdf8;
}

/* Light Theme Overrides */
html.light {
  background-color: #f8fafc;
  color: #0f172a;
}

html.light body {
  background-color: #f8fafc;
  color: #0f172a;
}

html.light header {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom-color: #e2e8f0;
}

html.light .bg-slate-950,
html.light .bg-slate-925 {
  background-color: #ffffff;
}

html.light .bg-slate-900\/60,
html.light .bg-slate-900\/70,
html.light .bg-slate-900\/80,
html.light .bg-slate-900 {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

html.light .border-slate-800,
html.light .border-slate-800\/80,
html.light .border-slate-800\/90 {
  border-color: #e2e8f0;
}

html.light .text-white {
  color: #0f172a;
}

html.light .text-slate-400 {
  color: #64748b;
}

html.light .markdown-body {
  color: #1e293b;
}

html.light .markdown-body h1,
html.light .markdown-body h2 {
  color: #0f172a;
}

html.light .markdown-body table {
  background: #ffffff;
  border-color: #e2e8f0;
}

html.light .markdown-body th {
  background: #f8fafc;
  color: #1e293b;
  border-bottom-color: #cbd5e1;
}

html.light .markdown-body td {
  border-bottom-color: #f1f5f9;
}
