﻿:root {
  /* Modern Light Theme Color System */
  --primary: #2c3e50; /* Dark Blue Gray */
  --primary-dark: #1a252f;
  --primary-light: #34495e;
  --secondary: #858796; /* Gray */
  --secondary-dark: #6c757d;
  --secondary-light: #f8f9fc;
  --accent: #f6c23e; /* Yellow */
  --accent-dark: #e0a800;
  --accent-light: #fff3cd;
  --success: #1cc88a; /* Green */
  --danger: #e74a3b; /* Red */
  --warning: #f6c23e;
  --info: #36b9cc; /* Cyan */

  /* Backgrounds */
  --bg-primary: #f8f9fc; /* Light Gray */
  --bg-secondary: #ffffff; /* White */
  --bg-tertiary: #f8f9fc; /* Light Gray */
  --bg-card: #ffffff;
  --bg-hover: #f8f9fc;

  /* Text */
  --text-primary: #5a5c69; /* Dark Gray */
  --text-secondary: #6c757d; /* Medium Gray */
  --text-muted: #858796; /* Light Gray */

  /* Borders */
  --border: #e3e6f0; /* Light Border */
  --border-light: #f8f9fc; /* Very Light */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 15px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Spacing */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 4rem;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}

.sidebar.show {
  transform: translateX(0);
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white !important;
  font-weight: 700;
  font-size: 1.25rem;
  transition: var(--transition);
}

.sidebar-brand:hover {
  color: rgba(255, 255, 255, 0.9) !important;
  transform: translateY(-1px);
}

.sidebar-brand i {
  font-size: 1.5rem;
}

.sidebar-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-body {
  padding: 1rem 0;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav .nav-item {
  margin: 0.25rem 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-radius: 0;
  position: relative;
}

.sidebar-nav .nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  padding-left: 2rem;
}

.sidebar-nav .nav-link:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav .nav-link span {
  font-weight: 500;
}

.sidebar-nav .btn {
  margin: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
}

.sidebar-nav .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}



/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1040;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

/* Mobile Sidebar */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  main.container {
    margin-left: 0;
    padding: 1rem;
  }
}

/* Desktop Sidebar */
@media (min-width: 992px) {
  .sidebar-overlay {
    display: none;
  }

  .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-toggle {
    display: none;
  }

  main.container {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.collapsed + main.container {
    margin-left: 0;
  }

  /* Hide mobile cards on desktop */
  .mobile-menu-cards {
    display: none !important;
  }

  /* Ensure table is visible on desktop */
  .table-responsive {
    display: block !important;
  }
}

/* Main Content */
main.container {
  padding: 2rem;
  min-height: calc(100vh - var(--header-height));
}

/* Search and Filter */
.input-group {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.input-group-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  font-weight: 600;
  transition: var(--transition);
}

.input-group:focus-within .input-group-text {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: scale(1.05);
}

.form-control,
.form-select {
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-weight: 500;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: none;
  transform: translateX(2px);
}

.form-control::placeholder {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.7;
}

/* Enhanced Search Bar */
#searchi {
  position: relative;
  max-width: 350px;
  animation: slideInFromTop 0.5s ease-out;
}

#searchi .input-group-text {
  min-width: 50px;
  justify-content: center;
  border-radius: var(--radius) 0 0 var(--radius);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

#searchi .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  letter-spacing: 0.025em;
}

#searchi .form-control:focus {
  border-left: 1px solid var(--primary);
}

#searchi::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#searchi:focus-within::before {
  opacity: 0.1;
}

/* Category and Food Type Filters */
#cati .input-group-text,
.food-type-filter .input-group-text {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
}

#cati:focus-within .input-group-text,
.food-type-filter:focus-within .input-group-text {
  background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
  transform: scale(1.05);
}

/* Clear Filters Button Enhancement */
#clearFilters {
  background: linear-gradient(135deg, var(--danger), #c82333);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
  min-width: 100px;
}

#clearFilters:hover {
  background: linear-gradient(135deg, #c82333, var(--danger));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
  color: white;
}

#clearFilters:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Mobile Search Bar Enhancements */
@media (max-width: 768px) {
  #searchi {
    max-width: 100%;
    margin-bottom: 0.5rem;
  }

  .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch !important;
  }

  .d-flex.gap-2 {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .input-group {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  #clearFilters {
    width: 60px;
    margin-top: 0.5rem;
    margin-left: auto;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }

  /* Mobile Food Type Button */
  .mobile-food-type-btn {
    width: 60px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  .mobile-food-type-btn i {
    font-size: 1rem;
  }

  .mobile-food-type-btn span {
    display: none; /* Hide text on very small screens */
  }
}

/* Animations */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search Icon Animation */
#searchi .bi-search {
  transition: transform 0.3s ease;
}

#searchi:focus-within .bi-search {
  transform: rotate(360deg);
}

/* Menu Table Styles */
.table-responsive {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}

#menu-items-table {
  margin-bottom: 0;
  background: var(--bg-card);
}

#menu-items-table thead th {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-weight: 700;
  border: none;
  padding: 1rem;
  text-align: center;
  vertical-align: middle;
}

#menu-items-table tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

#menu-items-table tbody tr:hover {
  background: var(--bg-hover);
  transform: scale(1.01);
}

#menu-items-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  text-align: center;
  border: none;
}

#menu-items-table tbody td:first-child {
  width: 80px;
}

#menu-items-table tbody td:nth-child(2) {
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
}

#menu-items-table tbody td:nth-child(3) {
  font-weight: 500;
  color: var(--text-secondary);
}

#menu-items-table tbody td:nth-child(4) {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

#menu-items-table tbody td:nth-child(5) {
  width: 100px;
}

#menu-items-table tbody td:nth-child(6) {
  width: 100px;
}

#menu-items-table tbody td:nth-child(7) {
  width: 150px;
}

/* Item Image in Table */
.menu-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  transition: var(--transition);
}

.menu-item-image:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* Food Type Badge */
.food-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.food-type-badge.veg {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.food-type-badge.non-veg {
  background: linear-gradient(135deg, #dc3545, #fd7e14);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.active {
  background: linear-gradient(135deg, #1cc88a, #17a673);
  color: white;
  box-shadow: 0 2px 8px rgba(28, 200, 138, 0.3);
}

.status-badge.inactive {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  color: white;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Action Buttons */
.action-btns {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 6px 15px rgba(44, 62, 80, 0.3);
  color: white;
  background: linear-gradient(135deg, #2c3e50, #1a252f);
}

.btn-primary {
  background: linear-gradient(135deg, #2c3e50, #1a252f);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2e59d9, #1a3bb8);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(46, 89, 217, 0.6);
}

/* Small Icon-Text Buttons */
.btn-small {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  box-shadow: 0 3px 8px rgba(78, 115, 223, 0.25);
  background: linear-gradient(135deg, #4e73df, #2e59d9);
  color: white;
  gap: 0.3rem;
  min-width: 60px;
  justify-content: center;
  transition: all 0.3s ease;
}

.btn-small i {
  font-size: 1rem;
  line-height: 1;
}

.btn-small:hover {
  background: linear-gradient(135deg, #2e59d9, #1a3bb8);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 8px 20px rgba(46, 89, 217, 0.5);
  color: white;
}

/* Specific styles for btn-action, btn-edit, and delete button */
.btn-action {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 3px 10px rgba(78, 115, 223, 0.3);
  background: linear-gradient(135deg, #4e73df, #2e59d9);
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  min-width: 70px;
  justify-content: center;
}

.btn-action i {
  font-size: 1rem;
  line-height: 1;
}

.btn-action.btn-edit {
  background: linear-gradient(135deg, #1cc88a, #17a673);
  box-shadow: 0 4px 12px rgba(28, 200, 138, 0.4);
}

.btn-action.btn-edit:hover {
  background: linear-gradient(135deg, #17a673, #13875a);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(19, 135, 90, 0.6);
  color: white;
}

.btn-action.btn-delete {
  background: linear-gradient(135deg, #e74a3b, #b02a27);
  box-shadow: 0 4px 12px rgba(231, 74, 59, 0.4);
}

.btn-action.btn-delete:hover {
  background: linear-gradient(135deg, #b02a27, #7a1a18);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(122, 26, 24, 0.6);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #1cc88a, #17a673);
  color: white;
  box-shadow: 0 6px 15px rgba(28, 200, 138, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #17a673, #13875a);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(19, 135, 90, 0.6);
}

.btn-danger {
  background: linear-gradient(135deg, #e74a3b, #b02a27);
  color: white;
  box-shadow: 0 6px 15px rgba(231, 74, 59, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b02a27, #7a1a18);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(122, 26, 24, 0.6);
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid #4e73df;
  color: #4e73df;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background: #4e73df;
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(78, 115, 223, 0.6);
}

/* Modals */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  color: var(--text-primary);
  font-weight: 700;
}

.modal-body {
  color: var(--text-secondary);
}

.modal-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.btn-close {
  filter: none;
  color: #e74a3b;
  background-color: transparent;
  opacity: 0.8;
  transition: var(--transition);
}

.btn-close:hover {
  opacity: 1;
  color: #b02a27;
}

/* Form Controls */
.form-control,
.form-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease forwards;
  color: var(--text-primary);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Theme Editor */
.theme-color-picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.theme-color-picker label {
  min-width: 120px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-color-picker input[type="color"] {
  width: 50px;
  height: 50px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.theme-color-picker input[type="color"]:hover {
  transform: scale(1.1);
}

.theme-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
  transition: var(--transition);
}

.theme-preview:hover {
  box-shadow: var(--shadow-md);
}

.theme-preview .menu-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.theme-preview .menu-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-preview .menu-item h5 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.theme-preview .menu-item p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.theme-preview .menu-item .price {
  color: var(--accent);
  font-weight: 700;
}

.theme-preview .menu-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
}

/* Preview Modal */
#previewModal .modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
  background: var(--bg-card);
}

#previewModal .modal-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#previewModal .modal-title {
  color: var(--text-primary);
  font-weight: 700;
}

#previewModal .modal-body {
  padding: 0;
  background: var(--bg-primary);
}

#previewFrame {
  width: 100%;
  height: 80vh;
  border: none;
  background: var(--bg-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: var(--transition);
}

#previewModal .modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

#openNewTab {
  background: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--text-primary);
}

#openNewTab:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Loading Spinner */
.spinner-border {
  color: var(--primary);
}

/* Categories List */
#categoriesList {
  max-height: 400px;
  overflow-y: auto;
}

#categoriesList .list-group-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: var(--transition);
}

#categoriesList .list-group-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

#categoriesList .list-group-item button {
  opacity: 0.7;
  transition: var(--transition);
}

#categoriesList .list-group-item:hover button {
  opacity: 1;
}

/* Delete Category Confirmation Modal - Higher z-index for proper stacking */
#deleteCategoryConfirmModal {
  z-index: 1070;
}

#deleteCategoryConfirmModal .modal-backdrop {
  z-index: 1065;
}

/* Mobile Header */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  box-shadow: var(--shadow-md);
  background: #000;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 105%;
  z-index: 1020;
  margin-top: -38px;
  margin-left: -10px;
}

.mobile-logo {
  width: 180px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius);
  background: transparent;
  padding: 0.25rem;
  margin-left: -190px;

}

.mobile-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  /* Mobile Layout Adjustments */
  main.container {
    padding: 1rem 0.5rem;
    margin-left: 0 !important;
    
  }

  /* Mobile Header */
  header.d-flex {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Mobile Filters - Stack vertically with better spacing */
  .d-flex.justify-content-between.align-items-center.mb-3 {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch !important;
  }

  .d-flex.gap-2 {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .input-group {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* Mobile Search and Filters */
  #searchi, #cati {
    margin-top: 0 !important;
  }

  .input-group-text {
    padding: 0.5rem 0.75rem;
  }

  .form-control, .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  /* Mobile Add Item Button */
  .add-item-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }

  /* Mobile Table - Switch to Card Layout */
  .table-responsive {
    display: none; /* Hide table on mobile */
  }

  /* Mobile Card Layout */
  .mobile-menu-cards {
    display: block;
    padding: 0;
  }

  .mobile-menu-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,255,255,0.98) 100%);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
  }

  .mobile-menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
  }

  .mobile-menu-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  }

  .mobile-menu-card .card-body {
    padding: 0.75rem;
  }

  .mobile-menu-card .d-flex.align-items-start {
    margin-bottom: 0.5rem;
  }

  .mobile-card-image {
    width: 48px;
    height: 48px;
    border-radius: 0.375rem;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
  }

  .mobile-menu-card .flex-grow-1 {
    margin-left: 0.75rem;
  }

  .mobile-menu-card h6.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
  }

  .mobile-menu-card .card-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-menu-card .d-flex.justify-content-between.align-items-center {
    margin-bottom: 0.25rem;
  }

  .mobile-menu-card .fw-bold {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
  }

  .mobile-menu-card .food-type-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .mobile-menu-card .d-flex.justify-content-between.align-items-center:nth-child(2) small {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .mobile-menu-card .status-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  .mobile-menu-card .d-flex.gap-2.mt-3 {
    margin-top: 0.75rem !important;
    display: flex;
    flex-wrap: nowrap;
  }

  .mobile-menu-card .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    font-weight: 600;
    min-height: 28px;
    max-width: 70px;
  }

  .mobile-menu-card .btn-delete {
    background: linear-gradient(135deg, #e74a3b, #b02a27);
    color: white;
    border: none;
  }

  .mobile-menu-card .btn-delete:hover {
    background: linear-gradient(135deg, #b02a27, #7a1a18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 74, 59, 0.4);
  }

  .mobile-menu-card .btn i {
    font-size: 0.8rem;
    margin-right: 0.25rem;
  }

  /* Mobile Sidebar Improvements */
  .sidebar {
    width: 280px;
    z-index: 1060;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-overlay {
    z-index: 1055;
  }

  .sidebar-toggle {
    top: 0.75rem;
    left: 0.75rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-toggle i {
    font-size: 1.2rem;
  }

  /* Mobile Modal Improvements */
  .modal-dialog {
    margin: 0.5rem;
    max-width: none;
    width: calc(100vw - 1rem);
  }

  .modal-content {
    border-radius: var(--radius-lg);
  }

  .modal-fullscreen-lg-down .modal-dialog {
    margin: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
  }

  .modal-fullscreen-lg-down .modal-content {
    height: 100vh;
    border-radius: 0;
  }

  /* Mobile Form Improvements */
  .form-control, .form-select {
    min-height: 44px; /* Better touch targets */
    font-size: 1rem;
  }

  .btn {
    min-height: 44px;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }

  /* Mobile Toast Positioning */
  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
    width: auto;
  }

  .toast {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 576px) {
  /* Extra Small Screens */
  main.container {
    padding: 0.5rem 0.25rem;
  }

  .mobile-menu-card-header {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .mobile-menu-card-image {
    width: 40px;
    height: 40px;
  }

  .mobile-menu-card-body {
    padding: 0.5rem;
  }

  .mobile-menu-card-title {
    font-size: 0.85rem;
  }

  .mobile-menu-card-price {
    font-size: 0.9rem;
  }

  .sidebar {
    width: 260px;
  }

  .sidebar-toggle {
    top: 0.5rem;
    left: 0.5rem;
    width: 40px;
    height: 40px;
  }

  .sidebar-toggle i {
    font-size: 1.1rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn, .btn-action {
    min-height: 48px;
    padding: 0.75rem 1rem;
    
  }

  .mobile-menu-card:hover {
    transform: none;
  }

  .sidebar-nav .nav-link:hover {
    padding-left: 1.5rem;
  }

  .sidebar-nav .nav-link:hover::before {
    display: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile-menu-card {
    border: 2px solid var(--text-primary);
  }

  .sidebar {
    border-right: 2px solid var(--text-primary);
  }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.p-1 {
  padding: 0.5rem;
}

.p-2 {
  padding: 1rem;
}

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.w-100 {
  width: 100%;
}

/* Mobile Add Item Button (Above Bottom Nav) */
.mobile-add-item-btn {
  position: fixed;
  bottom: 80px; /* Above the bottom nav (which is 60px + padding) */
  left: 20px; /* Positioned on the left side */
  width: 50px; /* Small width */
  height: 50px; /* Small height */
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 1035; /* Above bottom nav */
  transition: var(--transition);
  text-decoration: none;
}

.mobile-add-item-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
  color: white;
  text-decoration: none;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0;
  z-index: 1030;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  min-width: 60px;
  border: 1px solid transparent;
  background: transparent;
}

.mobile-nav-item:hover {
  color: var(--primary);
  background-color: var(--bg-hover);
  transform: translateY(-1px);
}

.mobile-nav-item.active {
  color: var(--primary);
  background-color: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 0.125rem;
}

.mobile-nav-item span {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Add button specific styling */
.mobile-nav-item.add-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-color: var(--primary);
}

.mobile-nav-item.add-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Adjust main content padding for mobile bottom nav */
@media (max-width: 991.98px) {
  main {
    padding-bottom: 5rem;
  }
}
