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

:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --text-primary: #2d3436;
  --text-secondary: #6c757d;
  --border-color: #e9ecef;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --hover-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --primary-color: #3498db;
  --primary-hover: #2980b9;
}

[data-theme="dark"] {
  --bg-primary: #1a1d21;
  --bg-secondary: #242931;
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --border-color: #2d3436;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  --hover-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --primary-color: #2980b9;
  --primary-hover: #3498db;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: #2d2d2d;
  border-color: #444;
  color: #e0e0e0;
}

.table-light-green {
  background-color: #d4edda !important;
}

.table-light-orange {
  background-color: #fff3cd !important;
}

.table-light-red {
  background-color: #f8d7da !important;
}

/* Sidebar styles */
.wrapper {
  display: flex;
  width: 100%;
  align-items: stretch;
}

#sidebar {
  min-width: 250px;
  max-width: 250px;
  min-height: 100vh;
  background: #2c3e50;
  transition: transform 0.3s ease, margin-left 0.3s ease;
  position: fixed;
  height: 100%;
  z-index: 1000;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  left: 0;
  top: 0;
  margin-left: 0;
}

#sidebar.active {
  transform: translateX(-250px);
}

#content {
  width: 100%;
  margin-left: 250px;
  transition: margin-left 0.3s ease;
  position: relative;
}

#content.active {
  margin-left: 250px;
}

.sidebar-header {
  padding: 20px;
  background: #243444;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  color: #ecf0f1;
  font-size: 1.5rem;
  /* Ensure consistent font size */
  margin-bottom: 0;
}

.sidebar-nav .nav-link {
  padding: 15px 20px;
  color: #ecf0f1;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: #34495e;
  color: #fff;
}

.sidebar-nav .nav-link i {
  font-size: 1.2rem;
}

#sidebarCollapse {
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  display: none;
  background: #2c3e50;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
}

#sidebarCollapse:hover {
  background: #34495e;
}

#sidebarCollapse:active {
  transform: scale(0.95);
}

html[data-theme="dark"] #sidebar {
  background: #1a1a1a;
}

html[data-theme="dark"] .sidebar-header {
  background: #252525;
}

html[data-theme="dark"] .sidebar-nav .nav-link {
  color: #e0e0e0;
}

html[data-theme="dark"] .sidebar-nav .nav-link:hover,
html[data-theme="dark"] .sidebar-nav .nav-link.active {
  background: #2d2d2d;
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 250px;
    margin-left: 0;
    z-index: 1050;
    transform: translateX(-250px);
  }

  #sidebar.active {
    transform: translateX(0);
    z-index: 1050;
  }

  /* Also support mobile-specific class used by JS */
  #sidebar.active-mobile {
    transform: translateX(0);
    z-index: 1050;
  }

  #content {
    margin-left: 0 !important;
    width: 100%;
    position: relative;
    z-index: 1000;
  }

  /* mobile-specific content state */
  #content.active-mobile {
    margin-left: 0;
  }

  #sidebarCollapse {
    display: block !important;
    z-index: 1051;
  }

  /* Ensure sidebar is scrollable */
  #sidebar {
    overflow-y: auto;
  }
}

/* Base Styles */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button - Fixed Position */
.theme-toggle {
  position: fixed;
  top: 16px;
  /* Align with navbar height */
  right: 120px;
  /* More space from logout */
  z-index: 1030;
  /* Above navbar */
  width: 38px;
  height: 38px;
  padding: 7px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--card-shadow);
  position: fixed !important;
  /* Ensure sticky */
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--hover-shadow);
}

.theme-toggle i {
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Navbar Styling */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  background-color: var(--bg-secondary);
}

.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.nav-tabs .nav-link:hover {
  color: var(--primary-color);
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  background: none;
  border: none;
}

.nav-tabs .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #3498db;
  transition: all 0.3s ease;
}

/* Updated Navbar Styling */
.main-nav {
  background-color: var(--bg-secondary);
  padding: 1rem;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.navbar-nav {
  gap: 0.5rem;
  /* Add consistent spacing between nav items */
}

.navbar-nav .nav-link {
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  margin: 0 0.2rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link.active {
  color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.1);
  font-weight: 500;
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.05);
}

/* Ensure even spacing in navbar */
.navbar-nav:not(.ms-auto) {
  margin-right: auto;
}

/* Navbar and Theme Toggle Refinements */
.navbar-nav .nav-item:last-child {
  margin-left: 3rem;
  /* Add space before logout */
}

/* Card Styling */
.card {
  cursor: pointer;
  background-color: var(--bg-secondary);
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.card-body {
  padding: 1.5rem;
}

/* Table Styling */
.table {
  border-collapse: separate;
  border-spacing: 0 8px;
  margin-top: -8px;
  color: var(--text-primary);
}

.table thead th {
  border-bottom: none;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 1rem;
  background-color: var(--bg-secondary);
}

/* Ensure all rows have a white background */
.table tbody tr {
  background-color: var(--bg-secondary) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Optional: Remove any hover effects if unwanted */
.table tbody tr:hover {
  background-color: var(--bg-primary) !important;
  /* Slight hover effect */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Highlight rows with danger class */
.table-danger {
  background-color: #f8d7da !important;
  /* Light red background */
  color: #721c24 !important;
  /* Dark red text */
}

/* Dark mode specific for table-danger */
html[data-theme="dark"] .table-danger {
  background-color: #4a2a2d !important;
  /* Darker red for dark mode */
  color: #f5c6cb !important;
  /* Lighter red text for dark mode */
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  border: none;
}

.table td span.badge {
  font-size: 0.9em;
  font-weight: bold;
  border-radius: 4px;
}

/* Button Styling */
.btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Input Styling */
.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Input placeholder color */
.form-control::placeholder {
  color: var(--text-secondary);
}

/* Badge Styling */
.badge {
  padding: 0.5rem 0.8rem;
  font-weight: 500;
  border-radius: 6px;
}

/* Fulfillment Logs Timeline */
#fulfillmentLogs {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  margin-top: 15px;
}

#fulfillmentLogs .timeline-item {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid #ddd;
  min-width: 200px;
}

#fulfillmentLogs .timeline-item .timestamp {
  font-size: 0.8rem;
  color: #6c757d;
}

#fulfillmentLogs .timeline-item .status {
  font-weight: bold;
  margin-top: 5px;
}

#fulfillmentLogs .timeline-item .rider {
  font-size: 0.9rem;
  color: #495057;
  margin-top: 5px;
}

/* Order Logs Timeline */
#orderLogs {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 20px;
  /* Space between timeline items */
  padding: 10px 0;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  margin-top: 15px;
}

#orderLogs .timeline-item {
  flex: 0 0 auto;
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid #ddd;
  min-width: 200px;
  /* Set a consistent width for each card */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Subtle shadow for better visibility */
}

#orderLogs .timeline-item .timestamp {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 5px;
}

#orderLogs .timeline-item .status {
  font-weight: bold;
  font-size: 1rem;
  color: #495057;
  margin-bottom: 5px;
}

#orderLogs .timeline-item .time-difference {
  font-size: 0.85rem;
  color: #6c757d;
}

/* Timeline Styling */
.timeline {
  display: flex;
  overflow-x: auto;
  padding: 1rem 0;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #3498db #f8f9fa;
}

.timeline::-webkit-scrollbar {
  height: 6px;
}

.timeline::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 3px;
}

.timeline::-webkit-scrollbar-thumb {
  background-color: #3498db;
  border-radius: 3px;
}

.timeline-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  border: 1px solid var(--border-color);
}

.timeline-item:hover {
  transform: translateY(-2px);
}

/* Mobile Responsive Styles for Order ID Search Bar */
@media (max-width: 768px) {
  .input-group {
    flex-direction: column;
  }

  .input-group .form-control {
    margin-bottom: 10px;
    width: 100%;
    /* Ensure the input takes full width */
  }

  .input-group .btn {
    width: 100%;
    /* Ensure the button takes full width */
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .nav-tabs .nav-link {
    padding: 0.6rem 1rem;
  }

  .table td,
  .table th {
    padding: 0.75rem;
  }

  .timeline {
    gap: 0.75rem;
  }

  .timeline-item {
    min-width: 180px;
    padding: 0.75rem;
  }

  .form-control,
  .form-select,
  .btn {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  #filterContainer,
  #dateFilterContainer {
    gap: 0.5rem;
  }

  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }

  .input-group {
    flex-direction: column;
  }

  .input-group .form-control {
    margin-bottom: 10px;
  }

  .input-group .btn {
    width: 100%;
  }

  #filterContainer,
  #dateFilterContainer {
    flex-direction: column;
  }

  #filterContainer .form-control,
  #dateFilterContainer .form-select,
  #dateFilterContainer .form-control {
    margin-bottom: 10px;
  }

  #filterContainer .btn {
    width: 100%;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }

  .theme-toggle {
    top: 15px;
    right: 70px;
  }

  .navbar-nav .nav-item:last-child {
    margin-left: 0;
  }
}

/* Mobile Responsive Styles for Order Details */
@media (max-width: 768px) {
  .card {
    padding: 15px;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .timeline {
    flex-direction: row;
    gap: 10px;
  }

  .timeline-item {
    min-width: 100%;
  }

  #actionButtons {
    flex-direction: row;
  }

  #actionButtons .btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Animation Styles */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.table tbody tr,
.card,
.timeline-item {
  animation: fadeIn 0.3s ease forwards;
}

/* Status Badge Colors */
.badge-created {
  background-color: #ffeaa7;
  color: #d35400;
}

.badge-pending {
  background-color: #fab1a0;
  color: #c0392b;
}

.badge-paid {
  background-color: #55efc4;
  color: #00b894;
}

.badge-delivered {
  background-color: #81ecec;
  color: #00cec9;
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.spinner-border {
  color: #3498db;
  width: 2rem;
  height: 2rem;
}

/* No Results Message */
.no-results {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
  font-weight: 500;
}

/* Restaurant Card Styling */
.restaurant-card {
  height: 100%;
  padding: 2.5rem 1.5rem 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.restaurant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.restaurant-card.inactive {
  border-left: 4px solid #dc3545;
}

.restaurant-card.active {
  border-left: 4px solid #28a745;
}

.restaurant-card .store-id {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  /* Change from right to left for better layout */
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-primary);
  border-radius: 4px;
  z-index: 1;
  max-width: calc(100% - 2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.restaurant-card .restaurant-name {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0.5rem 0 1rem;
  padding-right: 0;
  word-break: break-word;
  min-height: 2.8rem;
  /* Ensure consistent height for title */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.restaurant-card .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: auto;
}

.restaurant-card .info-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.restaurant-card .info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.restaurant-card .info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.restaurant-card .map-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.restaurant-card .map-link:hover {
  text-decoration: underline;
}

.restaurant-card .btn-primary {
  padding: 0.6rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 6px;
}

.restaurant-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

/* Enhanced Restaurant Card Styling */
.restaurant-card {
  padding: 1.5rem;
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.restaurant-card.inactive {
  border-left: 4px solid #dc3545;
}

.restaurant-card.active {
  border-left: 4px solid #28a745;
}

.restaurant-card .store-id {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.restaurant-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.5rem;
}

.restaurant-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  flex: 1;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-badge.active {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.status-badge.inactive {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 0;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
}

.restaurant-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.address-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.map-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.map-link:hover {
  text-decoration: underline;
}

/* No More Restaurants Message */
#noMoreRestaurantsMessage {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-top: 2rem;
  display: none;
}

#noMoreRestaurantsMessage i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Mobile Responsiveness Updates */
@media (max-width: 768px) {
  .restaurant-card {
    padding: 1.25rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .restaurant-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .status-badge {
    align-self: flex-start;
  }

  .store-id {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 0.5rem;
  }
}

/* Loading Indicator for Restaurants */
#loadingIndicator {
  text-align: center;
  padding: 2rem;
  display: none;
}

#loadingIndicator .spinner-border {
  width: 3rem;
  height: 3rem;
  color: var(--primary-color);
}

/* Search Bar Styling */
.search-bar {
  margin-bottom: 2rem;
}

.search-bar .form-control {
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.search-bar .form-control:focus {
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  border-color: var(--primary-color);
}

/* Restaurant Card Grid - Updated for better responsiveness */
#restaurantsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
  align-items: stretch;
}

.restaurant-card {
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.restaurant-card .info-grid {
  flex: 1;
  margin: 1rem 0;
}

.restaurant-card .restaurant-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Responsive grid adjustments */
@media (min-width: 1400px) {
  #restaurantsGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) and (max-width: 1399px) {
  #restaurantsGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  #restaurantsGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  #restaurantsGrid {
    grid-template-columns: 1fr;
  }

  .restaurant-card {
    min-height: unset;
  }
}

@media (min-width: 1400px) {
  #restaurantsGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) and (max-width: 1399px) {
  #restaurantsGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  #restaurantsGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  #restaurantsGrid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    right: 70px;
    top: 15px;
  }
}

/* Restaurant Card Grid */
#restaurantsGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
  margin: 0 auto;
  max-width: 1400px;
}

.restaurant-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  width: 340px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.restaurant-card.active {
  border-left: 5px solid #4caf50;
}

.restaurant-card.inactive {
  border-left: 5px solid #ff4c4c;
}

.restaurant-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.store-id {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  padding: 5px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.restaurant-header {
  margin-top: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.restaurant-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  padding-right: 80px;
  line-height: 1.4;
}

.status-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 0;
  padding: 10px 0;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.4;
}

.restaurant-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.address-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 5px 0;
}

.map-link:hover {
  text-decoration: underline;
}

.btn-primary {
  margin-top: 10px;
  padding: 10px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Search Bar Enhancement */
.search-bar {
  max-width: 800px;
  margin: 0 auto 30px;
  padding: 0 20px;
}

.search-bar .input-group {
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-bar .form-control {
  height: 50px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  padding: 10px 20px;
}

/* Loading and No More Messages */
#loadingIndicator,
#noMoreRestaurantsMessage {
  width: 100%;
  text-align: center;
  padding: 30px;
  margin: 20px 0;
  background: var(--bg-secondary);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  #restaurantsGrid {
    padding: 10px;
    gap: 15px;
  }

  .restaurant-card {
    width: 100%;
    margin: 0;
  }

  .search-bar {
    padding: 0 15px;
  }
}

/* Enhanced Search Bar */
.search-bar {
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
}

.search-bar .input-group {
  padding: 5px;
  background: var(--bg-secondary);
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-bar .input-group:focus-within {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.search-bar .input-group-text {
  border: none;
  background: transparent;
  padding-left: 15px;
}

.search-bar .form-control {
  height: 55px;
  font-size: 1.1rem;
  border: none;
  padding: 10px 20px;
  background: transparent;
}

.search-bar .form-control:focus {
  box-shadow: none;
}

/* Enhanced Card Hover Effects */
.restaurant-card {
  transform-origin: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.restaurant-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.restaurant-card .btn-primary {
  transform: translateY(0);
  transition: all 0.3s ease;
}

.restaurant-card:hover .btn-primary {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.restaurant-card .map-link {
  transition: all 0.2s ease;
}

.restaurant-card .map-link:hover {
  color: var(--primary-hover);
  transform: translateX(3px);
}

/* Enhance Status Badge */
.status-badge {
  margin-top: 12px;
  transition: all 0.2s ease;
}

.status-badge.active {
  background-color: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

.status-badge.inactive {
  background-color: rgba(255, 76, 76, 0.15);
  color: #ff4c4c;
}

.status-badge:hover {
  transform: scale(1.05);
}

/* Better Card Info Layout */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 15px 0;
}

.info-item {
  transition: all 0.2s ease;
}

.info-item:hover {
  transform: translateX(3px);
}

.info-label i {
  transition: transform 0.2s ease;
}

.info-item:hover .info-label i {
  transform: scale(1.2);
}

/* Responsive Grid Improvements */
@media (min-width: 1400px) {
  #restaurantsGrid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px;
  }
}

@media (max-width: 768px) {
  .search-bar {
    margin: 20px auto;
  }

  .search-bar .form-control {
    height: 50px;
    font-size: 1rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .restaurant-card {
    margin: 10px;
  }

  .restaurant-card:hover {
    transform: translateY(-5px) scale(1.01);
  }
}

#restaurantsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 25px;
  padding: 25px;
  max-width: 1600px;
  margin: 0 auto;
}

.restaurant-card {
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(var(--animation-order) * 0.1s);
  opacity: 0;
}

.search-bar {
  margin: 40px auto;
  animation: fadeInUp 0.5s ease;
}

#loadingIndicator {
  margin: 40px auto;
  padding: 40px;
}

#loadingIndicator .spinner-border {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

#noMoreRestaurantsMessage {
  margin: 40px auto;
  padding: 30px;
  font-size: 1.1rem;
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* Add these styles at the end of the file */
.table-responsive {
  margin-top: 20px;
  clear: both;
}

#filterContainer,
#dateFilterContainer {
  margin-bottom: 15px;
}

.nav-container+.table-responsive {
  margin-top: 20px;
}

/* Search Container Enhancements */
.search-container {
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: 0 15px;
}

.search-container .input-group {
  flex-wrap: nowrap;
  background: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.search-container .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.search-container .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  white-space: nowrap;
}

/* Mobile Responsive Search */
@media (max-width: 768px) {
  .search-container {
    padding: 0 10px;
  }

  .search-container .input-group {
    flex-direction: row;
    gap: 0;
  }

  .search-container .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .search-container .btn {
    width: auto;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

/* Notifications Page Specific Styles */
.content-area {
  background-color: var(--bg-secondary);
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-top: 20px;
}

.content-area h2 {
  color: var(--text-primary);
  margin-bottom: 25px;
  font-weight: 600;
  font-size: 1.8rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

#notificationForm button[type="submit"] {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#notificationForm button[type="submit"]:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

#responseMessage {
  text-align: center;
  padding: 15px;
  border-radius: 8px;
  font-weight: 500;
  margin-top: 25px;
  font-size: 1rem;
}

#responseMessage.success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

#responseMessage.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

#responseMessage.info {
  background-color: rgba(52, 152, 219, 0.1);
  color: #3498db;
}

/* Notification List Styles (WhatsApp-like UI) */
.notification-list {
  margin-top: 20px;
}

.notification-item {
  background-color: var(--bg-primary);
  /* Lighter background for items */
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  /* Ensures image corners are rounded */
}

.notification-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.notification-item .card-body {
  padding: 18px 20px;
}

.notification-item .card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.notification-item .card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.notification-item .img-fluid {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  /* Slightly rounded corners for images */
  margin-bottom: 10px;
}

.notification-item .card-link {
  font-size: 0.9rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: 5px;
}

.notification-item .card-link:hover {
  text-decoration: underline;
}

.notification-item .card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.notification-item .notification-meta p {
  margin-bottom: 3px;
  /* Reduce space between meta lines */
  font-size: 0.85rem;
  /* Slightly larger font for meta info */
  display: flex;
  align-items: center;
  gap: 5px;
}

.notification-item .notification-meta p strong {
  font-weight: 600;
  /* Make labels bolder */
  color: var(--text-primary);
  /* Ensure labels are visible in dark mode */
}

/* Mobile optimization for notification items */
@media (max-width: 768px) {
  .notification-item .card-body {
    padding: 15px;
  }

  .notification-item .card-title {
    font-size: 1.05rem;
  }

  .notification-item .card-text {
    font-size: 0.9rem;
  }

  .notification-item .notification-meta p {
    font-size: 0.8rem;
  }
}

/* Pagination Styles */
.pagination {
  margin-top: 30px;
  margin-bottom: 0;
  /* Remove default bottom margin */
}

.pagination .page-item .page-link {
  border-radius: 8px;
  margin: 0 4px;
  padding: 8px 15px;
  color: var(--primary-color);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.pagination .page-item .page-link:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.pagination .page-item.disabled .page-link {
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  cursor: not-allowed;
}

/* Dark mode adjustments for notification items */
html[data-theme="dark"] .notification-item {
  background-color: #242931;
  /* Darker background for items in dark mode */
  border-color: #2d3436;
}

html[data-theme="dark"] .notification-item .card-title {
  color: #e9ecef;
}

html[data-theme="dark"] .notification-item .card-text {
  color: #adb5bd;
}

html[data-theme="dark"] .notification-item .notification-meta {
  color: var(--text-primary);
  /* Ensure better visibility for meta info */
}

html[data-theme="dark"] .pagination .page-item .page-link {
  background-color: #242931;
  border-color: #2d3436;
  color: #e0e0e0;
}

html[data-theme="dark"] .pagination .page-item .page-link:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

html[data-theme="dark"] .pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

html[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background-color: #1a1d21;
  border-color: #2d3436;
  color: #6c757d;
}

/* Custom style for smaller text in home reports */
.small-text {
  font-size: 0.75rem;
  /* Adjust as needed */
  white-space: nowrap;
  /* Prevent text from wrapping */
  overflow: hidden;
  /* Hide overflow text */
  text-overflow: ellipsis;
  /* Show ellipsis for overflow text */
}

/* Responsive adjustments for summary cards and search bar */
@media (min-width: 769px) {
  .search-container {
    display: flex;
    flex-wrap: nowrap;
    /* Prevent wrapping on larger screens initially */
    justify-content: center;
    align-items: center;
    gap: 15px;
    /* Space between items */
    max-width: none;
    /* Remove max-width constraint for this layout */
  }

  .search-container>div {
    flex-shrink: 0;
    /* Prevent cards from shrinking too much */
    flex-grow: 0;
  }

  .search-container .input-group {
    flex-grow: 1;
    /* Allow search bar to take available space */
    max-width: 400px;
    /* Limit search bar width */
  }

  #todaysOrderSummary,
  #lastWeekOrderSummary {
    flex-basis: 200px;
    /* Give a base width to the cards */
    max-width: 250px;
    /* Max width to prevent them from becoming too wide */
  }
}

/* Further adjustments for very large screens */
@media (min-width: 1200px) {
  .search-container {
    gap: 25px;
  }

  #todaysOrderSummary,
  #lastWeekOrderSummary {
    flex-basis: 220px;
    max-width: 280px;
  }
}

/* Customer Details Page Specific Styles */
.customer-details-card .card-body h5,
.customer-details-card .card-body p {
  margin-bottom: 0.5rem;
}

.customer-details-card .card-body h5 {
  font-size: 1.25rem;
  font-weight: 600;
}

.customer-details-card .card-body p {
  font-size: 1rem;
  color: var(--text-secondary);
}

.customer-details-card .card-body p a {
  color: var(--primary-color);
  text-decoration: none;
}

.customer-details-card .card-body p a:hover {
  text-decoration: underline;
}

/* Table for customer orders */
#customerOrdersBody td {
  vertical-align: middle;
}

#customerOrdersBody td a {
  color: var(--primary-color);
  text-decoration: none;
}

#customerOrdersBody td a:hover {
  text-decoration: underline;
}

/* General styles for summary cards */
.summary-card {
  background-color: var(--bg-secondary);
  /* Use theme background color */
  color: var(--text-primary);
  /* Use theme text color */
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  /* Indicate clickable */
  border: 1px solid var(--border-color);
  /* Add a subtle border */
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-card p {
  margin-bottom: 0;
  line-height: 1.2;
}

/* Target only the count spans, not label spans */
#todaysOrderCount,
#previousDayOrderCount {
  font-size: 1.5em;
  font-weight: bold;
}

html[data-theme="dark"] .summary-card {
  background-color: var(--bg-secondary);
  /* Darker neutral for dark mode */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--border-color);
}

html[data-theme="dark"] .summary-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Specific styling for Today's Orders */
#todaysOrderSummary {
  background-color: #e0f2f7;
  /* Light blue */
  color: #005662;
}

html[data-theme="dark"] #todaysOrderSummary {
  background-color: #00363d;
  /* Darker blue */
  color: #e0f2f7;
}

/* Specific styling for Previous Day's Orders */
#previousDayOrderSummary {
  background-color: #ffe0b2;
  /* Light orange */
  color: #613100;
}

html[data-theme="dark"] #previousDayOrderSummary {
  background-color: #4d2600;
  /* Darker orange */
  color: #ffe0b2;
}

/* Mobile Responsiveness for Search Container and Summary Cards */
@media (max-width: 768px) {
  .search-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container .input-group {
    margin-right: 0 !important;
    /* Override me-md-3 */
    margin-bottom: 15px !important;
    /* Add space below search bar */
  }

  .summary-card {
    width: 100%;
    /* Full width on small screens */
    margin-right: 0 !important;
    /* Override me-md-2 */
    margin-bottom: 10px !important;
    /* Space between summary cards */
  }

  .summary-card:last-child {
    margin-bottom: 0 !important;
  }
}