:root {
  --primary-color: #0d6efd;
  --secondary-color: #198754;
  --bg-gradient: linear-gradient(135deg, #eef2f7 0%, #dbeafe 50%, #eff6ff 100%);
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --font-en: 'Outfit', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --accent-color: #f59e0b;
}

/* Global CSS Reset & Mobile Image Fallbacks */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

body {
  font-family: var(--font-en);
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 80px; /* Safe space for bottom navigation bar */
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.rtl {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}

/* Glassmorphism Container Classes */
.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

.glass-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Header & Navigation Bar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  height: 40px;
  width: auto;
  max-height: 40px;
  object-fit: contain;
}

.app-name {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-lang {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--primary-color);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.btn-lang:hover {
  background: var(--primary-color);
  color: white;
}

/* Main Search Bar styling */
.search-wrapper {
  margin: 16px 0;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  padding-inline-start: 48px;
  padding-inline-end: 48px;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  outline: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.search-icon-left {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
}
body.rtl .search-icon-left {
  left: auto;
  right: 20px;
}

.mic-icon-right {
  position: absolute;
  right: 20px;
  color: var(--text-muted);
  cursor: pointer;
}
body.rtl .mic-icon-right {
  right: auto;
  left: 20px;
}

/* Banner Carousel Slider */
.banner-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  height: 180px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: none;
  align-items: center;
  padding: 20px 30px;
}

.banner-slide.active {
  display: flex;
}

.banner-content {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  padding: 16px 24px;
  border-radius: 12px;
  max-width: 75%;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.banner-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.banner-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* Fast Tags / Filters */
.fast-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.filter-tag {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.filter-tag.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.filter-tag.hot {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
}

/* Categories 8 Grid layout mimicking user's attached design */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

@media (min-width: 600px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  z-index: 1;
}

.category-icon-wrapper {
  width: 80px;
  height: 80px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 5px rgba(255,255,255,0.6), 0 4px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  z-index: 2;
  flex-shrink: 0;
}

.category-icon-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}

.category-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  z-index: 2;
  font-family: var(--font-en);
}
body.rtl .category-title {
  font-family: var(--font-ar);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.category-card:hover .category-icon-wrapper {
  transform: scale(1.04);
}

/* Bottom Navigation Bar style mimicking mobile viewports */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 3px;
}

.nav-item.active {
  color: var(--primary-color);
}

/* Wizard Installation Setup Styles */
.wizard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.wizard-modal {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  color: #fff;
  padding: 24px;
}

.wizard-modal h2 {
  font-size: 22px;
  margin-bottom: 12px;
  text-align: center;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wizard-modal .form-group {
  margin-bottom: 14px;
}

.wizard-modal label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
}

.wizard-modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.wizard-modal input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.wizard-btn {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  color: #fff;
  border: none;
  padding: 14px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  margin-top: 16px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.wizard-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* General Layout Dashboard */
.main-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 24px;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Flex utilities and Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
@media (min-width: 600px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Dashboard statistics badge */
.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-color);
}

/* Branding settings Color Pickers container */
.color-picker-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.color-input-bubble {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 48px;
  height: 48px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

.color-input-bubble::-webkit-color-swatch {
  border-radius: 50%;
  border: 2px solid var(--glass-border);
}

/* Live Preview Mockup box */
.live-preview-box {
  border-radius: 16px;
  padding: 20px;
  background: #f8fafc;
  border: 1px dashed var(--text-muted);
  text-align: center;
}

/* Buttons */
.btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

/* Form Styles */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-color);
}

/* Leaflet map layout configuration */
#map-container {
  height: 350px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  margin: 16px 0;
  z-index: 10;
}

.tracking-alert {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #ef4444;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  margin: 10px 0;
  display: none;
}

/* Badges for Featured & Suspension tags */
.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-featured {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-active {
  background: #dcfce7;
  color: #15803d;
}

.badge-suspended {
  background: #fee2e2;
  color: #b91c1c;
}

/* Grid layout lists for details */
.list-item {
  background: white;
  border-radius: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(0,0,0,0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.provider-header-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 16px;
  margin-bottom: -40px;
  opacity: 0.85;
}

.provider-profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  background: white;
  margin-inline-start: 20px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  object-fit: cover;
}

/* Table styling for report templates */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
table.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}
table.report-table th, table.report-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
body.rtl table.report-table th, body.rtl table.report-table td {
  text-align: right;
}
table.report-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
}
table.report-table tr:hover {
  background: #fafafa;
}

/* Modal styling for meal picking and details viewing */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: white;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ============================================================= */
/* MOBILE RESPONSIVE MEDIA QUERIES (< 600px)                    */
/* ============================================================= */
@media (max-width: 600px) {
  header {
    padding: 10px 14px;
  }

  .brand-wrapper {
    gap: 8px;
  }

  .app-name {
    font-size: 17px;
  }

  .header-actions {
    gap: 8px;
  }

  .btn-lang {
    padding: 6px 10px;
    font-size: 12px;
  }

  #role-selector {
    padding: 4px 8px !important;
    font-size: 12px !important;
  }

  .main-wrapper {
    padding: 10px 12px;
  }

  .banner-carousel {
    height: 140px;
    margin-bottom: 16px;
    border-radius: 16px;
  }

  .banner-slide {
    padding: 14px;
  }

  .banner-content {
    max-width: 90%;
    padding: 10px 14px;
  }

  .banner-title {
    font-size: 15px;
  }

  .banner-subtitle {
    font-size: 12px;
  }

  .search-wrapper {
    margin: 12px 0;
  }

  .search-input {
    padding: 10px 14px;
    padding-inline-start: 38px;
    padding-inline-end: 38px;
    font-size: 14px;
  }

  .search-icon-left {
    left: 14px;
  }
  body.rtl .search-icon-left {
    right: 14px;
  }

  .mic-icon-right {
    right: 14px;
  }
  body.rtl .mic-icon-right {
    left: 14px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .category-card {
    padding: 12px 8px;
    border-radius: 18px;
    gap: 8px;
  }

  .category-icon-wrapper {
    width: 68px;
    height: 68px;
    max-width: 68px;
    max-height: 68px;
    border-radius: 16px;
  }

  .category-title {
    font-size: 12px;
  }

  .glass-container {
    padding: 14px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .glass-card {
    padding: 14px;
    border-radius: 14px;
  }

  .bottom-nav {
    height: 60px;
  }

  .nav-item {
    font-size: 10px;
  }

  .nav-item i {
    font-size: 18px;
  }
}
