/* The Feast Factory Bite Tracker - Core Styles & Design System */

:root {
  --bg-main: #0b0f19;
  --bg-card: #131c2e;
  --bg-card-hover: #1b263d;
  --bg-surface: #1e293b;
  --border-color: #27354f;
  --border-light: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #f59e0b;
  --accent-emerald: #10b981;
  --accent-indigo: #3b82f6;
  --accent-rose: #f43f5e;
}

html.light, html:not(.dark) {
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #e2e8f0;
  --border-color: #cbd5e1;
  --border-light: #94a3b8;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent-primary: #b45309;
  --accent-emerald: #047857;
  --accent-indigo: #1d4ed8;
  --accent-rose: #be123c;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 95px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Glassmorphism Header */
.glass-header {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Bottom Dual Settlement Bar */
.bottom-settle-bar {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
  user-select: none;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.96);
}

/* Segmented Navigation Control */
.nav-segmented {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 3px;
  gap: 3px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .nav-segmented {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 2px;
    gap: 2px;
  }
  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
    font-size: 0.725rem;
    gap: 3px;
  }
  .nav-tab svg {
    width: 13px;
    height: 13px;
  }
}

.nav-tab:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.nav-tab.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
  border-color: #3b82f6 !important;
}

/* Menu Grid Item Card */
.menu-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.menu-card:active {
  transform: scale(0.97);
}

.menu-card:hover {
  border-color: var(--accent-indigo);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.menu-card.selected {
  border-color: var(--accent-emerald) !important;
  background: rgba(16, 185, 129, 0.12) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3) !important;
}

/* Item Add Badge Button */
.item-add-btn {
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  user-select: none;
}

.menu-card:hover .item-add-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.item-qty-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-emerald);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Veg / Non-Veg Indicator */
.veg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 2px solid #059669;
  border-radius: 3px;
  padding: 1px;
}
.veg-badge::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #059669;
  border-radius: 50%;
}

.non-veg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 2px solid #e11d48;
  border-radius: 3px;
  padding: 1px;
}
.non-veg-badge::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #e11d48;
  border-radius: 50%;
}

/* Category Filter Pill */
.cat-pill {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-pill:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}
.cat-pill.active {
  background: var(--text-main) !important;
  color: var(--bg-main) !important;
  border-color: var(--text-main) !important;
  font-weight: 800;
}

/* Cart Quantity Control Buttons */
.cart-qty-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.12s ease;
}
.cart-qty-btn:hover {
  background: var(--bg-surface);
  color: #ffffff;
}

/* Settlement Buttons */
.btn-cash {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
/* Speed Dial / Top Bestseller Strip */
.speed-dial-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  -webkit-overflow-scrolling: touch;
}

.speed-dial-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.speed-dial-chip:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.speed-dial-chip:active {
  transform: scale(0.95);
}

.speed-dial-chip .price-tag {
  color: var(--accent-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
}

/* Mobile Slide-Up Cart Bottom Sheet */
.cart-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 2px solid var(--border-color);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  z-index: 58;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.cart-bottom-sheet.open {
  transform: translateY(0);
}

.cart-sheet-handle {
  width: 44px;
  height: 5px;
  background: var(--border-light);
  border-radius: 9999px;
  margin: 10px auto 4px auto;
  cursor: pointer;
}

/* Desktop Sidebar Sticky Cart */
@media (min-width: 1024px) {
  .desktop-sticky-cart {
    position: sticky;
    top: 75px;
    max-height: calc(100vh - 95px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

html.light .speed-dial-chip,
html:not(.dark) .speed-dial-chip {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

html.light .speed-dial-chip:hover,
html:not(.dark) .speed-dial-chip:hover {
  background: #fffbeb !important;
  border-color: #f59e0b !important;
}

html.light .cart-sheet-backdrop,
html:not(.dark) .cart-sheet-backdrop {
  background: rgba(15, 23, 42, 0.45) !important;
}

html.light .cart-bottom-sheet,
html:not(.dark) .cart-bottom-sheet {
  background: #ffffff !important;
  border-top-color: #cbd5e1 !important;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16) !important;
}

.btn-gpay {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.btn-gpay:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 75px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-emerald);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.error {
  border-left-color: var(--accent-rose);
}

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

/* =========================================================
   COMPREHENSIVE HIGH-CONTRAST LIGHT THEME SPECIFICITY RULES
   ========================================================= */

html.light,
html:not(.dark) {
  background-color: #f1f5f9 !important;
  color-scheme: light;
}

html.light body,
html:not(.dark) body {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

html.light .glass-header,
html:not(.dark) .glass-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

html.light .bottom-settle-bar,
html:not(.dark) .bottom-settle-bar {
  background: rgba(255, 255, 255, 0.98) !important;
  border-top: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Nav Segmented Control in Light Mode */
html.light .nav-segmented,
html:not(.dark) .nav-segmented {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html.light .nav-tab,
html:not(.dark) .nav-tab {
  color: #475569 !important;
}

html.light .nav-tab:hover,
html:not(.dark) .nav-tab:hover {
  background: #ffffff !important;
  color: #0f172a !important;
}

html.light .nav-tab.active,
html:not(.dark) .nav-tab.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25) !important;
}

/* Surfaces and Cards in Light Mode */
html.light .bg-dark-900,
html:not(.dark) .bg-dark-900 {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .bg-dark-800,
html.light .bg-slate-800,
html:not(.dark) .bg-dark-800,
html:not(.dark) .bg-slate-800 {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
  color: #0f172a !important;
}

html.light .bg-dark-950,
html:not(.dark) .bg-dark-950 {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light .bg-dark-700,
html.light .bg-slate-700,
html:not(.dark) .bg-dark-700,
html:not(.dark) .bg-slate-700 {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light .bg-dark-900\/80,
html.light .bg-dark-900\/90,
html:not(.dark) .bg-dark-900\/80,
html:not(.dark) .bg-dark-900\/90 {
  background-color: #f8fafc !important;
}

/* Override Dark Gradients in Light Mode */
html.light .bg-gradient-to-br,
html:not(.dark) .bg-gradient-to-br {
  background-image: none !important;
  background-color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

/* Borders in Light Mode */
html.light .border-slate-800,
html.light .border-slate-700,
html.light .border-slate-700\/80,
html.light .border-slate-700\/60,
html.light .border-slate-700\/50,
html.light .border-slate-700\/40,
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-700\/80,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .border-slate-700\/50,
html:not(.dark) .border-slate-700\/40 {
  border-color: #cbd5e1 !important;
}

/* Text Colors in Light Mode */
html.light .text-white,
html.light .text-slate-100,
html.light .text-slate-200,
html:not(.dark) .text-white,
html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200 {
  color: #0f172a !important;
}

html.light .text-slate-300,
html.light .text-slate-400,
html:not(.dark) .text-slate-300,
html:not(.dark) .text-slate-400 {
  color: #334155 !important;
}

html.light .text-slate-500,
html:not(.dark) .text-slate-500 {
  color: #64748b !important;
}

html.light .text-slate-600,
html:not(.dark) .text-slate-600 {
  color: #94a3b8 !important;
}

html.light .text-amber-400,
html:not(.dark) .text-amber-400 {
  color: #b45309 !important;
  font-weight: 800;
}

html.light .text-emerald-400,
html.light .text-emerald-300,
html.light .text-emerald-300\/80,
html:not(.dark) .text-emerald-400,
html:not(.dark) .text-emerald-300,
html:not(.dark) .text-emerald-300\/80 {
  color: #047857 !important;
  font-weight: 800;
}

html.light .text-blue-400,
html.light .text-blue-300,
html:not(.dark) .text-blue-400,
html:not(.dark) .text-blue-300 {
  color: #1d4ed8 !important;
  font-weight: 800;
}

html.light .text-rose-400,
html.light .text-rose-300,
html.light .text-rose-300\/80,
html:not(.dark) .text-rose-400,
html:not(.dark) .text-rose-300,
html:not(.dark) .text-rose-300\/80 {
  color: #be123c !important;
  font-weight: 800;
}

/* Badge Badges & Pill Overrides in Light Mode */
html.light .bg-emerald-500\/20,
html:not(.dark) .bg-emerald-500\/20 {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
  font-weight: 800 !important;
}

html.light .bg-blue-500\/20,
html:not(.dark) .bg-blue-500\/20 {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 800 !important;
}

html.light .bg-amber-500\/20,
html:not(.dark) .bg-amber-500\/20 {
  background-color: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  font-weight: 800 !important;
}

html.light .bg-rose-500\/20,
html:not(.dark) .bg-rose-500\/20 {
  background-color: #fff1f2 !important;
  color: #be123c !important;
  border: 1px solid #fecdd3 !important;
  font-weight: 800 !important;
}

html.light .bg-purple-500\/20,
html:not(.dark) .bg-purple-500\/20 {
  background-color: #faf5ff !important;
  color: #7e22ce !important;
  border: 1px solid #e9d5ff !important;
  font-weight: 800 !important;
}

html.light .bg-cyan-500\/20,
html:not(.dark) .bg-cyan-500\/20 {
  background-color: #ecfeff !important;
  color: #0e7490 !important;
  border: 1px solid #a5f3fc !important;
  font-weight: 800 !important;
}

html.light .bg-slate-500\/20,
html:not(.dark) .bg-slate-500\/20 {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 800 !important;
}

/* Add Item Button in Light Mode */
html.light .item-add-btn,
html:not(.dark) .item-add-btn {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 800 !important;
}

html.light .menu-card:hover .item-add-btn,
html:not(.dark) .menu-card:hover .item-add-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Cart Quantity Buttons in Light Mode */
html.light .cart-qty-btn,
html:not(.dark) .cart-qty-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
}

html.light .cart-qty-btn:hover,
html:not(.dark) .cart-qty-btn:hover {
  background: #f1f5f9 !important;
  color: #2563eb !important;
}

/* Inputs & Form Controls */
html.light input,
html.light select,
html.light textarea,
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #94a3b8 !important;
}

html.light input::placeholder,
html:not(.dark) input::placeholder {
  color: #94a3b8 !important;
}

html.light .theme-toggle-btn,
html:not(.dark) .theme-toggle-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light .menu-card,
html:not(.dark) .menu-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

html.light .menu-card:hover,
html:not(.dark) .menu-card:hover {
  background: #f8fafc !important;
  border-color: #2563eb !important;
}

html.light .menu-card.selected,
html:not(.dark) .menu-card.selected {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
}

html.light .cat-pill,
html:not(.dark) .cat-pill {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1.5px solid #cbd5e1 !important;
}

html.light .cat-pill.active,
html:not(.dark) .cat-pill.active {
  background: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}
