:root {
  --background: 44 48% 94%;
  --foreground: 156 24% 13%;
  --primary: 154 38% 30%;
  --primary-foreground: 42 55% 94%;
  --secondary: 28 55% 45%;
  --secondary-foreground: 42 55% 96%;
  --muted: 45 32% 86%;
  --muted-foreground: 154 12% 38%;
  --destructive: 2 62% 44%;
  --destructive-foreground: 42 55% 96%;
  --border: 42 22% 76%;
  --card: 43 52% 97%;
  --shadow-sm: 0 6px 18px hsl(154 35% 16% / 0.08);
  --shadow-md: 0 14px 32px hsl(154 35% 16% / 0.13);
  --shadow-lg: 0 24px 70px hsl(154 35% 16% / 0.18);
  --transition-fast: 150ms ease;
  --transition-smooth: 280ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 0.75rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.75rem;
}

.dark {
  --background: 154 22% 8%;
  --foreground: 42 46% 92%;
  --primary: 145 38% 61%;
  --primary-foreground: 154 24% 10%;
  --secondary: 32 72% 62%;
  --secondary-foreground: 154 24% 10%;
  --muted: 154 16% 16%;
  --muted-foreground: 43 20% 72%;
  --destructive: 4 70% 62%;
  --destructive-foreground: 154 24% 10%;
  --border: 154 14% 24%;
  --card: 154 22% 11%;
  --shadow-sm: 0 8px 20px hsl(0 0% 0% / 0.18);
  --shadow-md: 0 18px 38px hsl(0 0% 0% / 0.28);
  --shadow-lg: 0 28px 80px hsl(0 0% 0% / 0.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.font-serif { font-family: Georgia, Cambria, "Times New Roman", Times, serif; }

.scholar-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, hsl(var(--secondary) / 0.18), transparent 26rem),
    radial-gradient(circle at 88% 8%, hsl(var(--primary) / 0.18), transparent 22rem),
    linear-gradient(90deg, hsl(var(--foreground) / 0.035) 1px, transparent 1px),
    linear-gradient(0deg, hsl(var(--foreground) / 0.035) 1px, transparent 1px);
  background-size: auto, auto, 34px 34px, 34px 34px;
}

.btn-primary, .btn-secondary, .nav-chip, .day-chip, .icon-btn, .field {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), background var(--transition-smooth), border-color var(--transition-smooth), color var(--transition-smooth);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.85rem 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  padding: 0.85rem 1.25rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.nav-chip {
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: hsl(var(--muted-foreground));
}
.nav-chip:hover, .nav-chip-active {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}

.academic-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, hsl(var(--card)), hsl(var(--muted))),
    hsl(var(--card));
  padding: 1.35rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.academic-card::before {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border: 1px solid hsl(var(--border) / 0.7);
  border-radius: calc(var(--radius-lg) - 0.45rem);
  pointer-events: none;
}

.field {
  margin-top: 0.45rem;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.9rem 1rem;
  outline: none;
}
.field:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 4px hsl(var(--primary) / 0.12);
}

.day-chip {
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  padding: 0.55rem 0.8rem;
  font-weight: 800;
  font-size: 0.85rem;
}
.day-chip-active {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn.danger { color: hsl(var(--destructive)); }

.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)), hsl(var(--card)), hsl(var(--muted)));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

.animate-rise { animation: rise 320ms cubic-bezier(.2,.8,.2,1); }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

button { cursor: pointer; }
button:focus-visible, input:focus-visible {
  outline: 3px solid hsl(var(--primary) / 0.35);
  outline-offset: 2px;
}
