/* ============================================================
   DINE — Food Ordering System
   Design: Volcanic Glass palette — warm amber on deep charcoal
   Fonts: Bricolage Grotesque (display) + Plus Jakarta Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-deep:       #0F0E0C;
  --bg-card:       #1A1916;
  --bg-elevated:   #242220;
  --bg-hover:      #2E2C29;
  --border:        #333130;
  --border-light:  #3D3B38;

  --amber:         #F59E0B;
  --amber-light:   #FCD34D;
  --amber-dark:    #D97706;
  --amber-glow:    rgba(245,158,11,0.15);
  --amber-glow2:   rgba(245,158,11,0.08);

  --text-primary:  #F5F0E8;
  --text-secondary:#A89F8C;
  --text-muted:    #6B6560;

  --green:         #22C55E;
  --green-bg:      rgba(34,197,94,0.12);
  --red:           #EF4444;
  --red-bg:        rgba(239,68,68,0.12);
  --blue:          #3B82F6;
  --blue-bg:       rgba(59,130,246,0.12);

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     24px;
  --radius-full:   9999px;

  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.6);
  --shadow-amber:  0 4px 24px rgba(245,158,11,0.25);

  --transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);

  --font-display:  'Bricolage Grotesque', sans-serif;
  --font-body:     'Plus Jakarta Sans', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber); }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { color: var(--text-secondary); }
a { color: var(--amber); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--amber-light); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md); font-family: var(--font-body);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none;
  transition: var(--transition); white-space: nowrap; text-decoration: none;
}
.btn-primary {
  background: var(--amber); color: #0F0E0C;
  box-shadow: var(--shadow-amber);
}
.btn-primary:hover { background: var(--amber-light); transform: translateY(-1px); box-shadow: 0 6px 30px rgba(245,158,11,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--amber); color: var(--amber); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }

.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--red); color: white; }

.btn-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: var(--green); color: white; }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: var(--radius-md);
  padding: 12px 16px; font-family: var(--font-body); font-size: 0.95rem;
  transition: var(--transition); outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.form-error { font-size: 0.78rem; color: var(--red); margin-top: 2px; }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-elevated {
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 24px;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.badge-amber { background: var(--amber-glow); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.badge-blue { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-muted { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Toggle Switch ── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle {
  position: relative; width: 44px; height: 24px;
  background: var(--bg-hover); border-radius: var(--radius-full);
  transition: var(--transition); border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted); transition: var(--transition);
}
.toggle.active { background: var(--amber); border-color: var(--amber); }
.toggle.active::after { left: 22px; background: #0F0E0C; }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px; color: var(--text-muted);
  font-size: 0.8rem; margin: 8px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Loading Spinner ── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border-light);
  border-top-color: var(--amber); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0; background: rgba(15,14,12,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(4px);
}
.loading-box {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 40px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.loading-box .spinner { width: 40px; height: 40px; border-width: 3px; }

/* ── Toast Notifications ── */
#toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 380px;
  box-shadow: var(--shadow-lg); pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.toast.removing { animation: toastOut 0.25s ease forwards; }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg { font-size: 0.88rem; color: var(--text-primary); flex: 1; }
.toast-close { color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 2px; }
.toast-close:hover { color: var(--text-primary); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--amber); }

@keyframes toastIn { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); } to { opacity:0; transform: translateX(100%); } }

/* ── Alert Popup (Orders / Waiter Calls) ── */
.alert-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 10001; backdrop-filter: blur(6px);
  animation: fadeIn 0.3s ease;
}
.alert-popup {
  background: var(--bg-card); border: 2px solid var(--amber);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 0 60px rgba(245,158,11,0.3);
  animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.alert-popup .alert-icon { font-size: 3rem; margin-bottom: 12px; animation: pulse 1s ease infinite; }
.alert-popup h3 { font-size: 1.4rem; margin-bottom: 8px; color: var(--amber); }
.alert-popup p { color: var(--text-secondary); margin-bottom: 20px; }
.alert-popup .alert-actions { display: flex; gap: 12px; justify-content: center; }

@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes popIn { from { opacity:0; transform: scale(0.8); } to { opacity:1; transform: scale(1); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-xl); padding: 32px;
  max-width: 520px; width: 90%; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.modal-close { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

@keyframes slideUp { from { opacity:0; transform: translateY(30px); } to { opacity:1; transform: translateY(0); } }

/* ── Page Transitions ── */
.page { display: none; animation: pageIn 0.35s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ── Veg / Non-veg indicator ── */
.veg-dot {
  width: 14px; height: 14px; border-radius: 2px; flex-shrink: 0;
  border: 1.5px solid;
  display: flex; align-items: center; justify-content: center;
}
.veg-dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.veg-dot.veg { border-color: var(--green); }
.veg-dot.veg::after { background: var(--green); }
.veg-dot.nonveg { border-color: var(--red); }
.veg-dot.nonveg::after { background: var(--red); }

/* ── Quantity Controls ── */
.qty-control {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); overflow: hidden;
}
.qty-btn {
  width: 32px; height: 32px; background: transparent; border: none;
  color: var(--amber); font-size: 1.1rem; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--amber-glow); }
.qty-num { min-width: 32px; text-align: center; font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.text-center { text-align: center; }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .card, .card-elevated { padding: 16px; }
  .modal { padding: 24px; }
}