@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

body { font-family: 'Inter', sans-serif; }
code, pre { font-family: 'JetBrains Mono', monospace; }

.card-enter { animation: fadeSlideIn 0.3s ease forwards; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Markdown rendered content — plain CSS (Tailwind CDN does not support @apply) */
.md-content { line-height: 1.75; color: #374151; word-break: break-word; overflow-wrap: break-word; }

.md-content h1 { font-size: 1.5rem; font-weight: 700; margin: 1.5rem 0 1rem; color: #111827; }
.md-content h2 { font-size: 1.25rem; font-weight: 600; margin: 1.25rem 0 0.75rem; color: #1f2937; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.25rem; }
.md-content h3 { font-size: 1.05rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #374151; }

.md-content p  { margin-bottom: 0.875rem; }
.md-content p:last-child { margin-bottom: 0; }

.md-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 0.875rem; }
.md-content ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 0.875rem; }
.md-content li { margin-bottom: 0.25rem; }

.md-content strong { font-weight: 600; color: #111827; }
.md-content em     { font-style: italic; }

.md-content code {
  background: #f3f4f6;
  color: #db2777;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  white-space: pre-wrap;
  word-break: break-all;
}

.md-content pre {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0 1rem;
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.85rem;
  line-height: 1.65;
}
.md-content pre code {
  background: transparent;
  color: #e2e8f0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  word-break: normal;
}

.md-content blockquote {
  border-left: 4px solid #60a5fa;
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 0.75rem 0;
  color: #6b7280;
  font-style: italic;
  background: #eff6ff;
  border-radius: 0 0.5rem 0.5rem 0;
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  overflow-x: auto;
  display: block;
}
.md-content th {
  background: #f9fafb;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.md-content td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
}
.md-content tr:nth-child(even) td { background: #f9fafb; }

.md-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.25rem 0; }

/* Nav active state */
.nav-active { background: #eff6ff; color: #1d4ed8; font-weight: 500; }

/* Toast */
#toast {
  transition: all 0.3s ease;
  transform: translateY(100%);
  opacity: 0;
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Progress ring */
.progress-ring__circle {
  transition: stroke-dashoffset 0.5s ease;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.badge-correct { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; background: #dcfce7; color: #166534; }
.badge-wrong   { display: inline-flex; align-items: center; padding: 0.125rem 0.625rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; background: #fee2e2; color: #991b1b; }
