/* Family Meals — visual polish layer on top of daisyUI */

:root {
  --brand: #e11d48;
  --brand-soft: #fb7185;
  --ink: #1f2430;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  background-image:
    radial-gradient(60rem 30rem at 110% -10%, color-mix(in oklab, var(--brand) 12%, transparent), transparent),
    radial-gradient(50rem 25rem at -20% 110%, color-mix(in oklab, #0ea5e9 10%, transparent), transparent);
  background-attachment: fixed;
}

h1, h2, h3, .display-font, .card-title {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.015em;
}

/* ---------- navbar ---------- */
header.navbar {
  background: linear-gradient(120deg, #be123c 0%, #e11d48 45%, #f97316 110%);
  box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--brand) 55%, transparent);
  backdrop-filter: blur(8px);
}
header.navbar .btn:hover { transform: translateY(-1px); }

/* ---------- cards ---------- */
.card {
  transition: transform .25s ease, box-shadow .25s ease;
  border-radius: 1.25rem;
}
.card.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -18px rgb(0 0 0 / .35);
}
.card figure img { transition: transform .5s ease; }
.card.hover-lift:hover figure img { transform: scale(1.05); }

/* gradient scrim over meal photos so text stays readable */
.photo-card figure { position: relative; }
.photo-card figure::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / .45), transparent 55%);
}

/* staggered entrance */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.rise { animation: rise .45s cubic-bezier(.22,1,.36,1) both; }
.rise-1 { animation-delay: .05s } .rise-2 { animation-delay: .12s }
.rise-3 { animation-delay: .19s } .rise-4 { animation-delay: .26s }

@keyframes pop { from { transform: scale(.9); opacity: 0 } to { transform: none; opacity: 1 } }
.pop { animation: pop .3s cubic-bezier(.34,1.56,.64,1) both; }

/* ---------- ajax loading state (alpine-ajax sets aria-busy) ---------- */
[aria-busy="true"] { opacity: .55; pointer-events: none; transition: opacity .15s; position: relative; }
[aria-busy="true"]::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 1.5rem; height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border-radius: 9999px;
  border: 3px solid color-mix(in oklab, var(--brand) 25%, transparent);
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- calendar ---------- */
.cal-cell {
  min-height: 4.5rem;
  border-radius: .75rem;
  transition: background .2s;
}
.cal-cell:hover { background: color-mix(in oklab, var(--brand) 8%, transparent); }
.cal-cell.is-today {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: color-mix(in oklab, var(--brand) 10%, transparent);
}

/* ---------- stat bars ---------- */
.stat-bar {
  height: .5rem; border-radius: 9999px;
  background: color-mix(in oklab, var(--brand) 18%, transparent);
  overflow: hidden;
}
.stat-bar > span {
  display: block; height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  animation: grow .8s cubic-bezier(.22,1,.36,1) both;
}
@keyframes grow { from { width: 0 } }

/* ---------- buttons & inputs ---------- */
.btn { transition: transform .15s ease, box-shadow .2s ease, filter .2s; }
.btn-primary {
  box-shadow: 0 8px 20px -8px color-mix(in oklab, var(--brand) 60%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); }
.input:focus, .select:focus, .textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent);
}

/* swap affordance on plan cards */
.swap-chip {
  transition: transform .2s ease, background .2s;
}
.swap-chip:hover { transform: rotate(180deg) scale(1.1); }

/* toast: don't cover the page forever */
.toast { animation: rise .3s ease both; }

/* star rating inputs */
.rating input:checked { animation: pop .25s both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
