/* RestroAPP — visual polish & motion (loaded after restro.css).
   Every animation is switched off for people who ask their phone for reduced motion (bottom of file). */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-md: 0 6px 18px rgba(17, 24, 39, .08);
  --shadow-lg: 0 18px 40px rgba(17, 24, 39, .14);
  --radius: 16px;
  --app-bg: #fbf7f3;
}
[data-bs-theme="dark"] { --app-bg: #121417; --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 6px 18px rgba(0,0,0,.35); --shadow-lg: 0 18px 40px rgba(0,0,0,.5); }
body { background: var(--app-bg); }
[data-bs-theme="dark"] body { background: var(--app-bg); }

/* ---------- Splash ---------- */
#splash { background: radial-gradient(120% 90% at 50% 0%, #fb923c 0%, #ea580c 45%, #9a3412 100%); color: #fff; }
.splash-logo { animation: splash-pop .7s var(--ease-out) both; }
.splash-logo img { border-radius: 26px; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.splash-name { margin-top: 18px; font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; animation: rise .6s .15s var(--ease-out) both; }
.splash-tag { opacity: .85; font-weight: 600; animation: rise .6s .25s var(--ease-out) both; }
.splash-loader { display: flex; gap: 8px; margin-top: 26px; }
.splash-loader span:not(.visually-hidden) { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: dot 1s infinite ease-in-out; }
.splash-loader span:nth-child(2) { animation-delay: .15s; }
.splash-loader span:nth-child(3) { animation-delay: .3s; }
#splash-error:not(:empty) { background: #fff; color: #b91c1c; border-radius: 12px; padding: 10px 14px; margin: 18px; }
@keyframes splash-pop { 0% { transform: translateY(20px) scale(.7); opacity: 0; } 60% { transform: translateY(-6px) scale(1.04); opacity: 1; } 100% { transform: none; } }
@keyframes dot { 0%, 80%, 100% { transform: scale(.5); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- Login ---------- */
#view-login { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; background: radial-gradient(130% 80% at 0% 0%, #fdba74 0%, #f97316 35%, #c2410c 75%, #7c2d12 100%); }
[data-bs-theme="dark"] #view-login { background: radial-gradient(130% 80% at 0% 0%, #9a3412 0%, #7c2d12 40%, #2a1309 100%); }
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.float-food { position: absolute; left: var(--x); bottom: -12%; font-size: var(--s); opacity: .55; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); animation: float-up var(--d) linear infinite; animation-delay: var(--delay); }
@keyframes float-up { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-125vh) rotate(360deg); } }
.login-wrap { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; max-width: 1040px; margin: 0 auto; padding: 28px 18px; display: grid; grid-template-columns: 1fr; align-content: center; gap: 22px; }
@media (min-width: 900px) { .login-wrap { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px; } .login-foot { grid-column: 2; } }
.login-hero { color: #fff; text-align: center; animation: rise .7s var(--ease-out) both; }
@media (min-width: 900px) { .login-hero { text-align: left; } }
.login-logo { display: inline-block; animation: splash-pop .8s var(--ease-out) both; }
.login-logo img { border-radius: 24px; box-shadow: 0 16px 36px rgba(0,0,0,.28); }
.login-title { font-size: 2.4rem; font-weight: 900; margin: 14px 0 6px; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(0,0,0,.18); }
@media (min-width: 900px) { .login-title { font-size: 3.2rem; } }
.login-sub { font-size: 1.05rem; opacity: .95; margin: 0 auto 14px; max-width: 460px; }
@media (min-width: 900px) { .login-sub { margin-left: 0; } }
.login-sub-ur { display: block; font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif; opacity: .9; margin-top: 4px; line-height: 1.8; }
.login-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (min-width: 900px) { .login-chips { justify-content: flex-start; } }
.login-chips span { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .85rem; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.login-chips span:nth-child(n) { animation: rise .5s var(--ease-out) both; }
.login-chips span:nth-child(1) { animation-delay: .25s; } .login-chips span:nth-child(2) { animation-delay: .32s; } .login-chips span:nth-child(3) { animation-delay: .39s; } .login-chips span:nth-child(4) { animation-delay: .46s; } .login-chips span:nth-child(5) { animation-delay: .53s; }
.login-card { border: 0; border-radius: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.28); width: 100%; max-width: 440px; justify-self: center; animation: card-in .7s .1s var(--ease-out) both; background: color-mix(in srgb, var(--bs-body-bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.login-field .form-control { border-radius: 14px; border-width: 2px; }
.login-btn { border-radius: 14px; padding: 14px; font-weight: 800; background: linear-gradient(135deg, #f97316, #c2410c); border: 0; box-shadow: 0 10px 22px rgba(232, 89, 12, .35); transition: transform .12s, box-shadow .2s; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(232, 89, 12, .42); }
.login-btn:active { transform: scale(.98); }
.login-foot { color: rgba(255,255,255,.9); text-align: center; font-size: .85rem; justify-self: center; max-width: 440px; }
#login-error:not(.d-none) { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- App frame ---------- */
.app-topbar { background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
#topbar-title { font-weight: 800; }
#sidebar { background: var(--bs-body-bg); }
.sidebar-brand { background: linear-gradient(135deg, #f97316, #c2410c); color: #fff; border-bottom: 0; font-weight: 800; }
.sidebar-brand img { border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.nav-menu .nav-link { margin: 2px 10px; border-left: 0; border-radius: 12px; padding: 10px 12px; transition: background .15s, color .15s, transform .15s; }
.nav-menu .nav-link:hover { transform: translateX(2px); }
.nav-menu .nav-link.active { background: linear-gradient(135deg, rgba(249,115,22,.16), rgba(194,65,12,.12)); color: var(--brand-ink); box-shadow: inset 3px 0 0 var(--brand); }
.nav-menu .nav-section { padding: 16px 20px 4px; }
#bottom-nav { background: color-mix(in srgb, var(--bs-body-bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
#bottom-nav a { transition: color .15s, transform .15s; }
#bottom-nav a:active { transform: scale(.92); }
#bottom-nav a.active i { animation: nav-pop .35s var(--ease-out); }
#bottom-nav a.nav-sell i { background: linear-gradient(135deg, #f97316, #c2410c); }
@keyframes nav-pop { 50% { transform: translateY(-3px) scale(1.15); } }

/* Page enter */
#content.page-in > :not(.order-screen) { animation: rise .32s var(--ease-out) both; }
#content.page-in > .order-screen { animation: fade .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Staggered entrance for grids (first render only) */
.stagger > * { animation: tile-in .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Surfaces ---------- */
.card, .list-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card { border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-value { font-weight: 800; }
.home-tile, .exp-tile, .dish, .type-card, .ocard, .staff-card, .table-tile, .kot-card { transition: transform .15s var(--ease-out), box-shadow .2s, border-color .2s, background .2s; }
@media (hover: hover) {
  .home-tile:hover, .exp-tile:hover, .staff-card:hover, .ocard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .dish:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
  .table-tile:hover { transform: translateY(-2px); }
}
.btn { transition: transform .1s, box-shadow .2s, background-color .15s, border-color .15s, color .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary { box-shadow: 0 4px 12px rgba(232, 89, 12, .22); }
.form-control, .form-select { border-radius: 12px; }
.chip, .otab, .cat-btn, .pay-method { transition: all .15s var(--ease-out); }
.cat-btn.active, .otab.active { box-shadow: 0 4px 14px rgba(232, 89, 12, .2); transform: translateY(-1px); }
.pay-method.active { box-shadow: 0 4px 14px rgba(22, 163, 74, .2); }

/* Dialogs: rounded, rise in; full-screen sheets slide up on phones */
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--bs-border-color-translucent); }
.modal-title { font-weight: 800; }
.modal.fade .modal-dialog { transform: translateY(24px) scale(.97); transition: transform .28s var(--ease-out); }
.modal.show .modal-dialog { transform: none; }
@media (max-width: 575.98px) {
  .modal-fullscreen-sm-down .modal-content { border-radius: 0; }
  .modal.fade .modal-dialog.modal-fullscreen-sm-down { transform: translateY(40px); }
}
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(2px); }
.toast { border-radius: 14px; box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Home hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 20px 22px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #fb923c 0%, #ea580c 45%, #9a3412 100%); box-shadow: 0 14px 34px rgba(194, 65, 12, .28); }
.hero-text { flex: 1 1 220px; position: relative; z-index: 1; }
.hero-date { font-size: .85rem; opacity: .9; font-weight: 600; }
.hero-hello { font-size: 1.45rem; font-weight: 800; margin: 2px 0; }
.hero-biz { opacity: .9; font-weight: 600; }
.hero-stat { position: relative; z-index: 1; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 12px 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); min-width: 200px; }
.hero-stat-label { font-size: .8rem; font-weight: 700; opacity: .95; }
.hero-stat-label .lbl-ur { display: inline; margin-left: 6px; opacity: .9; }
.hero-stat-value { font-size: 1.8rem; font-weight: 900; line-height: 1.15; }
.hero-stat-sub { font-size: .8rem; opacity: .9; }
.hero-food { position: absolute; right: -10px; bottom: -18px; font-size: 4.2rem; opacity: .16; letter-spacing: -.1em; transform: rotate(-12deg); pointer-events: none; }
.setup-card { box-shadow: var(--shadow-md); }
.home-main { position: relative; overflow: hidden; }
.home-main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%); transform: translateX(-100%); animation: shine 4.5s 1.2s infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.home-emoji { transition: transform .2s var(--ease-out); }
@media (hover: hover) { .home-tile:hover .home-emoji, .exp-tile:hover .exp-emoji { transform: scale(1.12) rotate(-6deg); } }
.home-badge { animation: badge-pop .4s var(--ease-out); }
@keyframes badge-pop { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---------- Ordering ---------- */
.dish.bump .dish-qty { animation: badge-pop .3s var(--ease-out); }
.oline.just-added { animation: line-in .35s var(--ease-out); }
@keyframes line-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.cart-empty-icon { display: inline-block; animation: tap-hint 1.6s ease-in-out infinite; }
@keyframes tap-hint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.cart-bar.has-items { background: linear-gradient(135deg, #f97316, #c2410c); animation: bar-in .35s var(--ease-out); }
@keyframes bar-in { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
.order-screen.show-cart .cart-side { animation: sheet-up .3s var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.act-pay { background: linear-gradient(135deg, #22c55e, #15803d); }
.act-kitchen { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.type-card .type-emoji { transition: transform .25s var(--ease-out); }
@media (hover: hover) { .type-card:hover .type-emoji { transform: scale(1.12) rotate(-8deg); } }
.done-tick { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pop .35s var(--ease-out), ring 1.2s .35s ease-out; }
@keyframes ring { from { box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); } to { box-shadow: 0 0 0 26px rgba(22, 163, 74, 0); } }

/* Kitchen */
.kot-card.kot-arrive { animation: kot-arrive .7s var(--ease-out), kot-glow 1.6s .2s 2; }
@keyframes kot-arrive { from { opacity: 0; transform: translateY(-24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes kot-glow { 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, .35); } }
.kitchen-empty-emoji { display: inline-block; animation: tap-hint 2.4s ease-in-out infinite; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 4000; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; animation-name: confetti-fall; animation-timing-function: cubic-bezier(.3, .7, .4, 1); animation-fill-mode: forwards; }
@keyframes confetti-fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .9; } }

/* Empty states */
.empty-state i { display: inline-block; animation: tap-hint 2.6s ease-in-out infinite; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .float-food, .home-main::after { display: none; }
}

/* Login: compact on phones so everything fits on one screen */
@media (max-width: 899.98px) {
  .login-wrap { padding: 18px 16px; gap: 16px; }
  .login-logo img { width: 68px; height: 68px; border-radius: 20px; }
  .login-title { font-size: 2rem; margin: 8px 0 2px; }
  .login-sub { font-size: .92rem; margin-bottom: 10px; }
  .login-chips span { padding: 4px 10px; font-size: .78rem; }
  .login-card .card-body { padding: 20px !important; }
}
@media (min-width: 900px) { .login-sub { font-size: 1.15rem; } .login-chips span { font-size: .95rem; padding: 8px 14px; } }
