/* ============================================
   OrderGo Unified Portal Design System
   Professional Clean Orange & White Glassmorphism
   ============================================ */

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

:root {
  /* Colors */
  --bg-primary: #FAFAFA;
  --bg-secondary: #F4F4F5;
  --bg-tertiary: #E4E4E7;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-hover: rgba(255, 255, 255, 1);
  --bg-glass-active: rgba(244, 244, 245, 1);

  /* Orange Accents */
  --accent-primary: #F97316;
  --accent-primary-hover: #EA580C;
  --accent-primary-active: #C2410C;
  --accent-secondary: #FB923C;
  --accent-gradient: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
  --accent-gradient-hover: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
  --accent-glow: rgba(249, 115, 22, 0.18);
  --accent-tint: #FFF7ED;
  --accent-subtle: #FFEDD5;

  /* Status Colors */
  --status-pending: #F59E0B;
  --status-preparing: #3B82F6;
  --status-ready: #EA580C;
  --status-completed: #10B981;
  --status-cancelled: #EF4444;

  /* Text Hierarchy */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-accent: #EA580C;

  /* Borders */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-accent: rgba(249, 115, 22, 0.25);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 18px rgba(249, 115, 22, 0.18);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  --font-size-5xl: 3.5rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --max-width: 1200px;
  --navbar-height: 72px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0A0A14;
  --bg-secondary: #121220;
  --bg-tertiary: #1C1C2C;
  --bg-card: #141424;
  --bg-glass: rgba(20, 20, 36, 0.85);
  --bg-glass-hover: rgba(28, 28, 44, 0.9);
  --bg-glass-active: rgba(35, 35, 55, 0.95);

  --accent-tint: rgba(249, 115, 22, 0.1);
  --accent-subtle: rgba(249, 115, 22, 0.15);
  --accent-glow: rgba(249, 115, 22, 0.25);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #FB923C;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(249, 115, 22, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 18px rgba(249, 115, 22, 0.25);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-primary-hover);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-active);
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* --- Containers & Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page {
  padding-top: calc(var(--navbar-height) + var(--space-xl));
  padding-bottom: var(--space-3xl);
  flex: 1;
}

.page-header {
  margin-bottom: var(--space-2xl);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

/* Grids */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page { padding-top: calc(var(--navbar-height) + var(--space-md)); }
}

/* --- Card --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.25;
}

.btn-primary {
  background: var(--accent-primary);
  color: #FFFFFF !important;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 6px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary) !important;
  border-color: var(--border-medium);
}

.btn-secondary:hover {
  background: var(--accent-tint);
  border-color: var(--accent-primary);
  color: var(--accent-primary-hover) !important;
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary-hover) !important;
  border-color: var(--accent-primary);
}

.btn-outline:hover {
  background: var(--accent-primary);
  color: #FFFFFF !important;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary) !important;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary) !important;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626 !important;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #DC2626;
  color: #FFFFFF !important;
}

.btn-sm { padding: 0.5rem 0.9rem; font-size: var(--font-size-xs); }
.btn-lg { padding: 0.9rem 1.8rem; font-size: var(--font-size-md); }

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending   { background: rgba(245, 158, 11, 0.12); color: #D97706; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-preparing { background: rgba(59, 130, 246, 0.12); color: #2563EB; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-ready     { background: rgba(249, 115, 22, 0.12); color: #EA580C; border: 1px solid rgba(249, 115, 22, 0.25); }
.badge-completed { background: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-cancelled { background: rgba(239, 68, 68, 0.12); color: #DC2626; border: 1px solid rgba(239, 68, 68, 0.25); }

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  font-weight: 300;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.navbar-logo strong {
  font-weight: 800;
  color: var(--accent-primary-hover);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-link-admin {
  color: var(--accent-primary-hover);
  font-weight: 600;
}

.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: 0px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-primary);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  padding: 0 4px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--border-subtle);
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

/* Bottom Navigation */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Hide hamburger and desktop links entirely on mobile */
  .navbar-toggle { display: none !important; }
  .navbar-links { display: none !important; }

  /* Bottom Navigation Mobile Styling */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    height: 65px;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    flex: 1;
    text-decoration: none;
    position: relative;
    transition: color var(--transition-fast);
  }

  .bottom-nav-item i {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-fast);
  }

  .bottom-nav-item.active {
    color: var(--accent-primary);
  }
  
  .bottom-nav-item.active i {
    transform: translateY(-2px);
  }

  .bottom-nav-item .cart-badge {
    top: -5px;
    right: calc(50% - 15px);
  }

  /* Add padding to the page to prevent overlap with bottom nav */
  body {
    padding-bottom: 65px;
  }
  
  .site-footer {
    padding-bottom: calc(var(--space-2xl) + 65px);
  }
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 500;
  font-size: var(--font-size-sm);
  min-width: 250px;
  animation: toastIn 0.25s ease;
}

.toast-success { border-left: 4px solid var(--status-completed); }
.toast-error   { border-left: 4px solid var(--status-cancelled); }
.toast-info    { border-left: 4px solid var(--accent-primary); }

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

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0;
  margin-top: auto;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
