/* BudgetWise — supplemental styles layered on top of Tailwind. */

:root {
  color-scheme: light dark;
}

html { -webkit-text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }

/* Render newlines in lesson content as paragraph breaks via white-space. */
.lesson-prose {
  line-height: 1.8;
}
.lesson-prose p {
  margin-bottom: 1rem;
}
.lesson-prose p:last-child {
  margin-bottom: 0;
}
/* Drop-cap on the first paragraph for an editorial feel */
.lesson-prose > p:first-of-type::first-letter {
  font-size: 3.1rem;
  line-height: 0.8;
  font-weight: 800;
  float: left;
  margin: 0.1rem 0.6rem 0 0;
  color: #0f766e;
}
.dark .lesson-prose > p:first-of-type::first-letter { color: #2dd4bf; }

/* Custom scrollbar (webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgb(148 163 184 / 0.5);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgb(148 163 184 / 0.8);
}

/* Focus ring consistency for keyboard users */
:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Larger, comfortable touch targets on small screens */
@media (max-width: 640px) {
  button, [role="button"], a { -webkit-tap-highlight-color: transparent; }
  .option-btn { padding-top: .9rem; padding-bottom: .9rem; }
}

/* Option button states (driven by data-state attribute from JS) */
.option-btn {
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease, box-shadow .15s ease;
}
.option-btn:not([disabled]):hover { transform: translateY(-1px); }
.option-btn:active {
  transform: scale(.99);
}
.option-btn[data-state="correct"] {
  border-color: #16a34a;
  background-color: rgb(22 163 74 / 0.10);
}
.option-btn[data-state="wrong"] {
  border-color: #dc2626;
  background-color: rgb(220 38 38 / 0.10);
}
.option-btn[disabled] {
  cursor: default;
}
/* Keyboard hint badge inside option letters */
.option-btn kbd {
  font: inherit;
}

/* Stat card hover */
.stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-2px); }

/* Skeleton shimmer */
.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.4), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* Toast entry animation */
.toast {
  animation: toast-in .25s cubic-bezier(.21,1.02,.73,1) both;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Animated gradient utility for hero */
.bg-animated {
  background-size: 200% 200%;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
