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

/* ===== Variables ===== */
:root {
  --bg:        #0d1117;
  --surface:   #161b27;
  --surface2:  #1c2333;
  --border:    #2d3748;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --gold:      #f0c040;
  --gold-dim:  #c9a227;
  --green:     #3fb950;
  --red:       #f85149;
  --venmo:     #3D95CE;
  --zelle:     #6D1ED4;
  --shadow:    0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  --radius:    12px;
  --radius-sm: 8px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #161b27 0%, #1a2236 100%);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 1.25rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(240,192,64,0.08) 0%, transparent 65%);
  pointer-events: none;
}
.site-header h1 {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  position: relative;
  animation: titleGlow 2s ease-out 0.4s both;
}
@keyframes titleGlow {
  0%   { text-shadow: none; }
  35%  { text-shadow: 0 0 24px rgba(240,192,64,0.75), 0 0 56px rgba(240,192,64,0.3); }
  100% { text-shadow: none; }
}
.site-header .subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  position: relative;
}

/* ===== Main ===== */
main {
  padding: 1.5rem 1rem;
  padding-bottom: 120px;
  max-width: 680px;
  margin: 0 auto;
}

/* ===== Category sections ===== */
.category-section { margin-bottom: 2rem; }
.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.category-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.category-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* ===== Menu items list ===== */
.menu-list { display: flex; flex-direction: column; gap: 2px; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
  animation: itemIn 0.35s ease-out both;
}
@keyframes itemIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.menu-item:hover { border-color: var(--border); background: var(--surface2); }
.menu-item.sold-out { opacity: 0.45; }

.menu-item-left { flex: 1; min-width: 0; }
.menu-item-name {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.menu-item.sold-out .menu-item-name { text-decoration: line-through; }
.menu-item-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.menu-item-right { flex-shrink: 0; text-align: right; }
.menu-item-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.01em;
}
.sold-out-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  margin-top: 0.2rem;
  opacity: 0.8;
}

/* ===== Payment bar ===== */
.payment-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1rem;
  z-index: 100;
  transition: border-top-color 0.4s, box-shadow 0.4s;
}
.payment-bar.has-items {
  border-top-color: var(--gold-dim);
  box-shadow: 0 -4px 24px rgba(240,192,64,0.12);
}
.payment-bar-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.amount-row { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.cart-summary { display: flex; align-items: center; gap: 0.5rem; }
.cart-total { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.cart-count {
  background: var(--surface2);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border);
}
#cart-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.15rem 0.25rem;
}
#cart-clear:hover { color: var(--text); }

.pay-buttons { display: flex; gap: 0.5rem; flex: 1; }
.btn-venmo, .btn-zelle {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.4s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-venmo:active, .btn-zelle:active { transform: scale(0.97); filter: brightness(0.85); }
.btn-venmo { background: var(--venmo); color: white; }
.btn-zelle { background: var(--zelle); color: white; }
.pay-buttons.has-items .btn-venmo { box-shadow: 0 0 16px rgba(61,149,206,0.5); }
.pay-buttons.has-items .btn-zelle { box-shadow: 0 0 16px rgba(109,30,212,0.55); }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem 1rem 1rem;
  max-width: 680px;
  margin: 0 auto;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 28px; height: 28px;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }

/* Zelle modal */
.modal-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; color: #a78bfa; }
.zelle-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 600; margin-bottom: 0.375rem;
}
.zelle-contact-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.zelle-contact-row span { flex: 1; font-size: 1rem; font-weight: 600; word-break: break-all; color: var(--text); }
.btn-copy {
  padding: 0.4rem 0.8rem;
  background: var(--zelle); color: white; border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  font-family: inherit; flex-shrink: 0;
}
.zelle-note { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.zelle-amount { font-weight: 700; font-size: 1.1rem; color: var(--gold); text-align: center; padding-top: 0.5rem; display: none; }

/* ===== Empty / loading ===== */
.loading, .empty-state {
  text-align: center; color: var(--muted);
  padding: 4rem 1rem; font-size: 0.95rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 400;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none; max-width: calc(100vw - 2rem);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #2d1515; border-color: var(--red); color: var(--red); }

/* ===== Qty controls ===== */
.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-end;
}
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--gold);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.1s;
}
.qty-btn:active { transform: scale(0.9); }
.qty-count {
  font-size: 1rem;
  font-weight: 700;
  min-width: 1.5rem;
  text-align: center;
  color: var(--gold);
}

/* Cart active row */
.menu-item.in-cart {
  border-left: 2px solid var(--gold);
  background: var(--surface2);
}

/* ===== Total pop animation ===== */
@keyframes totalPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.22); }
  65%  { transform: scale(0.93); }
  100% { transform: scale(1); }
}
.cart-total.pop { animation: totalPop 0.28s ease-out; }

/* ===== Row flash on first add ===== */
@keyframes rowFlash {
  0%   { background: rgba(240,192,64,0.2); }
  100% { background: var(--surface2); }
}
.menu-item.flash { animation: rowFlash 0.55s ease-out; }

/* ===== Category pill nav ===== */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13,17,23,0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  white-space: nowrap;
  max-width: 680px;
  margin: 0 auto;
}
.cat-pill {
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.cat-pill:hover { color: var(--text); border-color: var(--muted); }
.cat-pill.active { background: var(--gold); color: #0d1117; border-color: var(--gold); }

/* ===== Skeleton loading ===== */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-section { margin-bottom: 2rem; }
.skeleton-cat-label {
  height: 0.6rem;
  width: 72px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 0.75rem;
}
.skeleton-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.skeleton-line {
  height: 0.8rem;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-price {
  height: 0.8rem;
  width: 36px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  flex-shrink: 0;
}

/* ============================================================
   ADMIN STYLES
   ============================================================ */

/* Login */
.admin-login-screen {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg); padding: 1rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 2rem; width: 100%; max-width: 360px;
}
.login-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.login-sub { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.login-error {
  background: #2d1515; color: var(--red);
  border: 1px solid #5c2222;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem; font-size: 0.85rem;
  margin-bottom: 1rem; display: none;
}

/* Shell */
.admin-shell { min-height: 100vh; background: var(--bg); display: none; flex-direction: column; }
.admin-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  color: var(--text); padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-header h1 { font-size: 1rem; font-weight: 700; }
.btn-logout {
  background: var(--surface2); color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.8rem; cursor: pointer; font-family: inherit;
}
.btn-logout:hover { color: var(--text); }
.admin-main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; }

/* Admin cards */
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-card-header {
  padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.75rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--surface2);
}
.admin-card-body { padding: 1.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group:last-of-type { margin-bottom: 0; }
.form-group label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); margin-bottom: 0.35rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-group input, .form-group select {
  width: 100%; padding: 0.6rem 0.75rem;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9rem; outline: none; transition: border-color 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus { border-color: #4ade80; }
.form-group select option { background: var(--surface2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }

/* Admin buttons */
.btn-primary {
  background: #238636; color: white; border: 1px solid #2ea043;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-sm-edit {
  background: #1c2d4a; color: #79c0ff;
  border: 1px solid #1f4a7a;
  padding: 0.3rem 0.65rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.btn-sm-delete {
  background: #2d1515; color: var(--red);
  border: 1px solid #5c2222;
  padding: 0.3rem 0.65rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.btn-sm-save {
  background: #238636; color: white; border: none;
  padding: 0.3rem 0.65rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-sm-cancel {
  background: var(--surface2); color: var(--muted); border: none;
  padding: 0.3rem 0.65rem; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* Items table */
.table-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 560px; }
.items-table th {
  text-align: left; padding: 0.6rem 0.75rem;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: var(--surface2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.items-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid #1e2536; vertical-align: middle; color: var(--text); }
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr:hover td { background: var(--surface2); }
.edit-input {
  width: 100%; padding: 0.3rem 0.5rem;
  background: var(--bg); border: 1.5px solid #4ade80;
  border-radius: 4px; color: var(--text);
  font-size: 0.85rem; outline: none; font-family: inherit;
}
.actions-cell { display: flex; gap: 0.375rem; justify-content: flex-end; white-space: nowrap; }

/* Toggle */
.toggle { position: relative; width: 36px; height: 20px; display: inline-flex; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: #30363d; border-radius: 20px;
  transition: 0.2s; cursor: pointer;
}
.toggle-track::before {
  content: ""; position: absolute;
  height: 14px; width: 14px; left: 3px; bottom: 3px;
  background: #8b949e; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-track { background: #238636; }
.toggle input:checked + .toggle-track::before { background: white; transform: translateX(16px); }

/* Add item row */
.add-item-row {
  display: grid;
  grid-template-columns: 2fr 80px 1.5fr 1fr auto;
  gap: 0.5rem; align-items: end;
  padding: 1rem 1.25rem;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
@media (max-width: 640px) {
  .add-item-row { grid-template-columns: 1fr 1fr; }
  .add-item-row .btn-primary { grid-column: 1 / -1; }
}
.add-item-row input, .add-item-row select {
  padding: 0.5rem 0.6rem;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.85rem; outline: none; font-family: inherit; width: 100%;
}
.add-item-row input:focus, .add-item-row select:focus { border-color: #4ade80; }
.add-item-row select option { background: var(--surface); }
.add-field-label {
  font-size: 0.7rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem;
}
.add-field { display: flex; flex-direction: column; }
