/* ========================================
   PROFESSIONAL RESTAURANT THEME - REDESIGNED
   Modern, Clean, Responsive & Test-Ready
   ======================================== */

/* CSS Variables for Consistent Theming */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #10b981;
  --accent: #f59e0b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --dark: #1f2937;
  --light: #f9fafb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --border-radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease;
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding-bottom: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--gray-900);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* Navigation */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: white !important;
  transition: var(--transition);
}

.navbar-brand:hover {
  opacity: 0.9;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white !important;
}

.loyalty-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: var(--gray-900);
  padding: 0.375rem 0.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  border-radius: var(--border-radius);
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: white;
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-outline-secondary {
  border: 2px solid var(--gray-300);
  color: var(--gray-700);
  background: white;
}

.btn-outline-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-900);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

/* Cards */
.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  background: white;
  margin-bottom: 1rem;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 1.25rem;
}

.card-header {
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  background: var(--gray-200);
}

/* Fallback for missing images */
.card-img-top[src=""], 
.card-img-top:not([src]),
.card-img-top[src*="placeholder"] {
  background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-300) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-img-top[src=""]::before,
.card-img-top:not([src])::before,
.card-img-top[src*="placeholder"]::before {
  content: '🍽️';
  font-size: 4rem;
  opacity: 0.3;
}

/* Forms */
.form-control, .form-select {
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  padding: 0.625rem 0.875rem;
  transition: var(--transition);
  font-size: 1rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

.form-control-sm, .form-select-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(30, 64, 175, 0.95) 100%),
              url('/images/hero-bg.jpg') center/cover;
  color: white;
  padding: 4rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

.hero-section h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-section p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2.5rem 0;
  }
  .hero-section h1 {
    font-size: 2rem;
  }
}

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Food Cards */
.food-card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.food-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.food-card .card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.food-card .card-text {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
  flex: 1;
}

.price-tag {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.top-selling-badge {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.category-tab {
  padding: 0.625rem 1.5rem;
  border-radius: 50px;
  background: white;
  border: 2px solid var(--gray-300);
  color: var(--gray-700);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-size: 0.9375rem;
}

.category-tab:hover, .category-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* Search Bar */
.search-bar {
  position: relative;
  max-width: 500px;
  margin: 1.5rem auto;
}

.search-bar input {
  width: 100%;
  padding: 0.875rem 3.5rem 0.875rem 1.25rem;
  border-radius: 50px;
  border: 2px solid var(--gray-300);
  font-size: 1rem;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.search-bar button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar button:hover {
  background: var(--primary-dark);
}

.search-bar button i {
  font-size: 1rem;
}

/* Cart Items */
.cart-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cart-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.cart-summary {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  position: sticky;
  top: 20px;
}

/* Quantity Controls */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quantity-control .btn-decrease,
.quantity-control .btn-increase {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1rem;
}

.quantity-control .btn-decrease:hover,
.quantity-control .btn-increase:hover {
  background: var(--primary);
  color: white;
}

.quantity-control input[type="number"] {
  width: 60px;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 0.375rem;
  font-weight: 600;
}

/* Payment Options */
.payment-option {
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.payment-option:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.02);
}

.payment-option.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.payment-option input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Status Badges */
.status-badge {
  padding: 0.375rem 0.875rem;
  border-radius: 50px;
  font-weight: 600;
  display: inline-block;
  font-size: 0.875rem;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-out-for-delivery { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Tables */
.table {
  width: 100%;
  margin-bottom: 0;
}

.table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.table th {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table-responsive {
  overflow-x: auto;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  padding: 0.875rem 1.125rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

/* Footer */
.footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.8);
  padding: 2.5rem 0 1rem;
  margin-top: auto;
}

.footer h5 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: white;
}

.footer hr {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0;
}

/* Badges */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.75rem;
}

.bg-primary { background: var(--primary) !important; color: white; }
.bg-secondary { background: var(--gray-600) !important; color: white; }
.bg-success { background: var(--success) !important; color: white; }
.bg-danger { background: var(--danger) !important; color: white; }
.bg-warning { background: var(--warning) !important; color: var(--gray-900); }
.bg-info { background: #3b82f6 !important; color: white; }

/* Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.text-muted { color: var(--gray-600); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.bg-light { background: var(--gray-50); }

/* Responsive */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    text-align: center;
  }
  
  .cart-item img {
    width: 100%;
    height: 200px;
  }
  
  .cart-summary {
    position: static;
  }
  
  .payment-option {
    flex-direction: column;
    text-align: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility */
.btn:focus, .form-control:focus, .form-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print */
@media print {
  .navbar, .footer, .btn, .search-bar, .category-tabs {
    display: none;
  }
}
