/* Theme System */
:root, [data-theme='light'] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --border-color: #dee2e6;
  --shadow-color: rgba(0,0,0,0.08);
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --table-bg: #ffffff;
  --table-hover: #f8f9fa;
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0d6efd 100%);
}

[data-theme='dark'] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --shadow-color: rgba(0,0,0,0.3);
  --input-bg: #1e293b;
  --input-border: #475569;
  --table-bg: #1e293b;
  --table-hover: #334155;
  --hero-gradient: linear-gradient(135deg, #020617 0%, #0f172a 50%, #1e3a5f 100%);
}

/* Dark mode overrides */
[data-theme='dark'] body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .card, [data-theme='dark'] .card-custom {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .bg-white {
  background-color: var(--bg-secondary) !important;
}

[data-theme='dark'] .bg-light {
  background-color: var(--bg-secondary) !important;
}

[data-theme='dark'] .text-dark {
  color: var(--text-primary) !important;
}

[data-theme='dark'] .text-muted {
  color: var(--text-secondary) !important;
}

[data-theme='dark'] .form-control {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .form-select {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .table {
  color: var(--text-primary) !important;
  --bs-table-bg: var(--table-bg);
  --bs-table-hover-bg: var(--table-hover);
}

[data-theme='dark'] .table-light {
  --bs-table-bg: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .modal-content {
  background-color: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

[data-theme='dark'] .admin-sidebar {
  background: #020617 !important;
}

[data-theme='dark'] .form-label {
  color: var(--text-primary) !important;
}

[data-theme='dark'] .alert-success {
  background-color: #064e3b !important;
  border-color: #065f46 !important;
  color: #6ee7b7 !important;
}

[data-theme='dark'] .alert-danger {
  background-color: #7f1d1d !important;
  border-color: #991b1b !important;
  color: #fca5a5 !important;
}

[data-theme='dark'] .alert-info {
  background-color: #1e3a5f !important;
  border-color: #1e40af !important;
  color: #93c5fd !important;
}

[data-theme='dark'] .hero-section {
  background: var(--hero-gradient) !important;
}

/* Theme toggle button style */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: transparent;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.theme-toggle-btn:hover {
  border-color: rgba(255,255,255,0.8);
  transform: scale(1.1);
}

/* Captain Drive - Custom Design System & CSS Styles */

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

:root {
  --primary-blue: #0d6efd;
  --primary-hover: #0b5ed7;
  --dark-accent: #0b0f19;
  --dark-card: #151d2a;
  --light-bg: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.95);
  --border-radius-lg: 16px;
  --border-radius-sm: 10px;
  --shadow-soft: 0 10px 30px rgba(11, 15, 25, 0.08);
  --shadow-elevated: 0 20px 40px rgba(11, 15, 25, 0.15);
  
  /* Responsive breakpoints */
  --breakpoint-mobile: 320px;
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-large: 1440px;
}

html, body {
  font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--light-bg);
  color: var(--dark-accent);
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive Base Styles */
* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

/* Touch-friendly tap targets */
button, a, input, select, textarea {
  min-height: 44px;
  min-width: 44px;
}

input, select, textarea {
  min-height: auto;
  padding: 12px 16px;
}

/* Splash / Loading Screen */
#app-splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--dark-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(13, 110, 253, 0.6);
  animation: pulseLogo 1.8s infinite ease-in-out;
}

@keyframes pulseLogo {
  0% { transform: scale(0.95); box-shadow: 0 0 20px rgba(13, 110, 253, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(13, 110, 253, 0.8); }
  100% { transform: scale(0.95); box-shadow: 0 0 20px rgba(13, 110, 253, 0.4); }
}

/* Custom Navigation Header */
.navbar-captain {
  background: var(--dark-accent);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  /* Must sit ABOVE .notif-overlay (1050) so notification-drawer backdrop
     can never swallow taps on the logout / bell buttons. */
  z-index: 1060;
}

.brand-logo-img {
  max-height: 48px;
  width: auto;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

.brand-logo-img:hover {
  transform: scale(1.04);
}

/* Role Selector Tabs */
.role-tabs {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 30px;
  display: inline-flex;
  gap: 4px;
}

.role-tabs .btn-role {
  color: #cbd5e1;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.role-tabs .btn-role.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}

/* View Sections */
.app-view {
  display: none;
  min-height: calc(100vh - 65px);
}

.app-view.active-view {
  display: block;
  /* No opacity animation — content must ALWAYS be fully visible from first paint */
}

/* Subtle slide-in only for inner content blocks, NOT the whole view */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0b0f19 0%, #151d2a 60%, #0d6efd 100%);
  color: #ffffff;
  padding: 4.5rem 1rem 4rem 1rem;
  position: relative;
  overflow: hidden;
}

/* ====== HERO VISIBILITY FIX ======
   All text, headings, paragraphs, buttons, and icons in the hero section
   must ALWAYS be visible. Never rely on hover or animation to show content.
   ================================= */
.hero-section,
.hero-section *,
.hero-section h1,
.hero-section h2,
.hero-section h3,
.hero-section h4,
.hero-section p,
.hero-section span,
.hero-section small,
.hero-section li {
  opacity: 1 !important;
  visibility: visible !important;
}

.hero-section .text-white,
.hero-section .text-white-50,
.hero-section [class*="text-"] {
  color: inherit !important;
}

.hero-section .hero-title {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-section .hero-sub {
  color: #cbd5e1 !important;
}

/* Navbar links always visible */
.public-nav-links a,
.navbar-captain a,
.navbar-captain button,
.navbar-captain span {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Remove hover-only visibility from nav links */
.hover-white {
  color: rgba(255,255,255,0.75) !important;
  transition: color 0.2s;
}
.hover-white:hover {
  color: #ffffff !important;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  color: #ffffff;
  opacity: 1;
}

.hero-sub {
  font-size: 1.15rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  max-width: 620px;
  opacity: 1;
}

.card-custom {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

/* Step 1 Account Type Choice Cards */
.account-choice-card {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #ffffff;
}

.account-choice-card:hover, .account-choice-card.selected {
  border-color: var(--primary-blue);
  background: #f0f7ff;
  box-shadow: 0 10px 25px rgba(13, 110, 253, 0.15);
  transform: translateY(-4px);
}

.account-choice-card i {
  font-size: 2.75rem;
  color: var(--primary-blue);
}

/* Document Upload Dropzones */
.doc-upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
}

.doc-upload-zone:hover {
  border-color: var(--primary-blue);
  background: #f0f7ff;
}

.doc-upload-zone i {
  font-size: 2rem;
  color: var(--primary-blue);
}

/* Map Containers */
.map-container {
  width: 100%;
  height: 100%;
  min-height: 380px;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.full-screen-map {
  height: calc(100vh - 65px);
  width: 100%;
  position: relative;
}

/* Map Pins */
.custom-map-pin .pin-marker {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.custom-map-pin .pin-marker i {
  transform: rotate(45deg);
  font-size: 1.1rem;
}

/* Rider Bottom Sheet Container */
.bottom-sheet {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 480px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: var(--shadow-elevated);
  padding: 1.25rem;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

html[dir="rtl"] .bottom-sheet {
  transform: translateX(50%);
}

/* Searching Ripple Animation */
.searching-ripple {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  margin: 1rem auto;
}

.searching-ripple div {
  position: absolute;
  border: 4px solid var(--primary-blue);
  opacity: 1;
  border-radius: 50%;
  animation: searching-ripple 1.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.searching-ripple div:nth-child(2) {
  animation-delay: -0.7s;
}

@keyframes searching-ripple {
  0% { top: 36px; left: 36px; width: 0; height: 0; opacity: 0; }
  5% { top: 36px; left: 36px; width: 0; height: 0; opacity: 1; }
  100% { top: 0px; left: 0px; width: 72px; height: 72px; opacity: 0; }
}

/* Counter Offer Pills */
.price-pill {
  border: 2px solid var(--primary-blue);
  background: #f0f7ff;
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.price-pill:hover, .price-pill.active {
  background: var(--primary-blue);
  color: #ffffff;
  transform: scale(1.05);
}

/* Star Rating System */
.star-rating {
  direction: ltr;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 2rem;
  color: #cbd5e1;
  cursor: pointer;
}

.star-rating i.selected, .star-rating i:hover {
  color: #f59e0b;
}

/* PWA Prompt Banner */
.pwa-banner {
  background: linear-gradient(90deg, #0d6efd 0%, #0b468c 100%);
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Sidebar & Nav for Admin */
.admin-sidebar {
  background: var(--dark-accent);
  color: #cbd5e1;
  min-height: calc(100vh - 65px);
  padding: 1.5rem 1rem;
}

.admin-nav-link {
  color: #94a3b8;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 6px;
  transition: all 0.2s ease;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.admin-nav-link.active i {
  color: var(--primary-blue);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .bottom-sheet { width: 95%; bottom: 10px; }
  .role-tabs { flex-wrap: wrap; justify-content: center; }
}

/* =====================================================================
   RTL / LTR COMPATIBILITY FIXES
   ===================================================================== */

/* Fix input-group border radius for both directions */
html[dir="rtl"] .input-group .form-control.rounded-start-pill {
  border-top-right-radius: 50rem !important;
  border-bottom-right-radius: 50rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

html[dir="rtl"] .input-group .btn.rounded-end-pill {
  border-top-left-radius: 50rem !important;
  border-bottom-left-radius: 50rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

html[dir="ltr"] .input-group .form-control.rounded-start-pill {
  border-top-left-radius: 50rem !important;
  border-bottom-left-radius: 50rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

html[dir="ltr"] .input-group .btn.rounded-end-pill {
  border-top-right-radius: 50rem !important;
  border-bottom-right-radius: 50rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Fix modal footer button order in RTL */
html[dir="rtl"] .modal-footer {
  flex-direction: row-reverse;
}

/* Ensure no horizontal overflow in any direction */
.app-view, section, .container, .container-fluid {
  max-width: 100%;
  overflow-x: hidden;
}

/* Fix form row gutter overflow on small screens */
@media (max-width: 576px) {
  .row.g-3, .row.g-2 {
    --bs-gutter-x: 0.75rem;
  }
  .doc-upload-zone {
    padding: 0.85rem;
  }
}

/* Auth sub-view container ensures no bleed */
.auth-sub-view {
  overflow-x: hidden;
}

/* Disabled submit button style */
#driver-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#driver-submit-btn {
  transition: all 0.3s ease;
}

/* Bottom sheet RTL/LTR safe centering */
.bottom-sheet {
  position: absolute;
  bottom: 20px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 92%;
  max-width: 480px;
}

html[dir="rtl"] .bottom-sheet {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

/* Fix navbar items wrapping in small screens */
@media (max-width: 480px) {
  .navbar-captain .d-flex.gap-3 {
    gap: 0.5rem !important;
  }
  .btn.rounded-pill.px-3 {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
}

/* Waiting/searching card: reduce padding + scale ripple on small screens so
   the countdown badge, expiry card, and cancel button stay above the fold */
@media (max-width: 576px) {
  #rider-sub-waiting .card,
  #rider-sub-offer .card {
    padding: 1.25rem !important;
  }
  #rider-sub-waiting .searching-ripple {
    transform: scale(0.8);
  }
  #search-expiry-wrap .btn {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
}

/* Fix account choice cards grid on mobile */
@media (max-width: 576px) {
  .account-choice-card {
    padding: 1.25rem;
  }
}

/* Ensure text-start works in both directions */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="ltr"] .text-start { text-align: left !important; }

/* ============================================================================
   COMPREHENSIVE RESPONSIVE DESIGN ENHANCEMENTS
   ============================================================================ */

/* Extra Small Devices (phones, 320px and up) */
@media (max-width: 479px) {
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  .hero-sub {
    font-size: 0.95rem;
  }
  
  .navbar-captain {
    padding: 0.5rem 0.75rem;
  }
  
  .brand-logo-img {
    max-height: 36px;
  }
  
  .card-custom {
    border-radius: 12px;
    padding: 1rem;
  }
  
  .map-container {
    min-height: 300px;
  }
  
  .bottom-sheet {
    width: 95%;
    padding: 1rem;
    bottom: 10px;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  /* Mobile navigation adjustments */
  .d-none.d-md-flex {
    display: none !important;
  }
  
  /* Hide less important elements on mobile */
  .desktop-only {
    display: none !important;
  }
  
  /* Adjust form layouts */
  .row > .col-md-6, .row > .col-md-4 {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  /* Touch-optimized interface */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }
  
  input, select, textarea {
    font-size: 16px; /* Prevent iOS zoom */
  }
}

/* Small Devices (landscape phones, 480px and up) */
@media (min-width: 480px) and (max-width: 767px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-sub {
    font-size: 1rem;
  }
  
  .card-custom {
    padding: 1.25rem;
  }
  
  .map-container {
    min-height: 350px;
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title {
    font-size: 2.25rem;
  }
  
  .hero-sub {
    font-size: 1.1rem;
  }
  
  .navbar-captain {
    padding: 0.75rem 1.5rem;
  }
  
  .card-custom {
    padding: 1.5rem;
  }
  
  .map-container {
    min-height: 400px;
  }
  
  .bottom-sheet {
    max-width: 600px;
  }
  
  /* Tablet navigation adjustments */
  .admin-sidebar {
    min-height: calc(100vh - 75px);
  }
  
  /* Two-column layouts for tablets */
  .row.g-4 > .col-md-6 {
    margin-bottom: 1.5rem;
  }
}

/* Large Devices (desktops, 1024px and up) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-sub {
    font-size: 1.15rem;
  }
  
  .navbar-captain {
    padding: 0.85rem 2rem;
  }
  
  .card-custom {
    padding: 1.75rem;
  }
  
  .map-container {
    min-height: 450px;
  }
  
  /* Desktop-specific features */
  .hover-white:hover {
    color: #ffffff !important;
  }
  
  /* Enable hover states */
  .card-custom:hover {
    transform: translateY(-3px);
  }
}

/* Extra Large Devices (large desktops, 1440px and up) */
@media (min-width: 1440px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .hero-sub {
    font-size: 1.25rem;
  }
  
  .container {
    max-width: 1400px;
  }
  
  .card-custom {
    padding: 2rem;
  }
  
  .map-container {
    min-height: 500px;
  }
  
  /* Enhanced shadows and effects for large screens */
  .card-custom {
    box-shadow: 0 15px 35px rgba(11, 15, 25, 0.1);
  }
}

/* ============================================================================
   MOBILE-SPECIFIC ENHANCEMENTS
   ============================================================================ */

/* Mobile-first touch optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .card-custom:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  /* Increase tap targets */
  .btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
  }
  
  input, select, textarea {
    min-height: 48px;
    font-size: 16px;
  }
  
  /* Adjust spacing for touch */
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  /* Make dropdowns more touch-friendly */
  .dropdown-menu {
    min-width: 200px;
    font-size: 16px;
  }
}

/* iOS-specific adjustments */
@supports (-webkit-touch-callout: none) {
  /* Prevent iOS bounce scrolling */
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix iOS input background */
  input, select, textarea {
    -webkit-appearance: none;
    border-radius: 0;
  }
}

/* Android-specific adjustments */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
  }
}

/* ============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-blue: #0056b3;
    --dark-accent: #000000;
    --light-bg: #ffffff;
  }
  
  .card-custom {
    border: 2px solid #000000;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .splash-logo {
    animation: none;
  }
  
  .card-custom:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #0f1419;
    --dark-accent: #f8fafc;
  }
  
  .card-custom {
    background: #1a2332;
    border-color: #2d3748;
    color: #f8fafc;
  }
  
  .text-muted {
    color: #a0aec0 !important;
  }
}

/* Focus states for keyboard navigation */
:focus {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

button:focus, a:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ============================================================================ */

@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-sub {
    font-size: 0.9rem;
  }
  
  .navbar-captain {
    padding: 0.5rem 1rem;
  }
  
  .map-container {
    min-height: 250px;
  }
  
  .bottom-sheet {
    padding: 0.75rem;
    bottom: 10px;
  }
}

/* ============================================================================
   NAVBAR BUTTON VISIBILITY FIXES (CRITICAL)
   ============================================================================ */

.navbar-captain .container-fluid {
  max-width: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  flex-wrap: nowrap !important;
}

.navbar-captain .d-flex.align-items-center {
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.5rem !important;
}

/* Ensure navbar content never overflows horizontally */
.navbar-captain {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.navbar-captain::-webkit-scrollbar {
  height: 3px;
}

.navbar-captain::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

/* Force button text to stay on one line, shrink gracefully */
.navbar-captain .btn {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 0;
}

/* Responsive navbar button sizing by breakpoint */
@media (max-width: 1100px) {
  .navbar-captain .btn.px-3 {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
  .navbar-captain .btn.btn-sm {
    font-size: 0.78rem !important;
  }
}

@media (max-width: 860px) {
  /* On medium screens, convert icon+text buttons to icon-only to save space */
  .navbar-captain #login-nav-btn .me-1,
  .navbar-captain #create-account-nav-btn .me-1,
  #app-back-nav .btn .me-1 {
    display: none;
  }
  .navbar-captain #login-nav-btn,
  .navbar-captain #create-account-nav-btn {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    min-width: auto !important;
  }
}

@media (max-width: 640px) {
  .navbar-captain .btn span[data-i18n] {
    font-size: 0.8rem;
  }
  .brand-logo-img {
    max-height: 32px !important;
  }
}

@media (max-width: 460px) {
  .navbar-captain {
    padding: 0.4rem 0.5rem !important;
  }
  .navbar-captain .btn.btn-sm {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.72rem !important;
    border-radius: 999px;
  }
  .theme-toggle-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }
}

/* Very small phones (<=380px): let navbar items wrap to a second row
   instead of forcing a horizontal scroll. */
@media (max-width: 380px) {
  .navbar-captain {
    overflow-x: visible;
    white-space: normal;
  }
  .navbar-captain .container-fluid,
  .navbar-captain .d-flex.align-items-center {
    flex-wrap: wrap !important;
    row-gap: 0.4rem;
  }
  .navbar-captain .btn {
    max-width: none;
  }
  .navbar-captain .brand-logo-img {
    max-height: 30px !important;
  }
}

/* ============================================================================
   MOBILE HEADER POLISH (phones) — single-row icon header
   Brand collapses to logo-only; auth/lang pills become 40px icon buttons.
   Desktop (>=768px) untouched: every rule below is max-width scoped.
   ============================================================================ */
@media (max-width: 767.98px) {
  .navbar-captain .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .navbar-captain .d-flex.align-items-center {
    gap: 0.375rem !important;
  }
  /* Notch safe-area top inset (browser + standalone PWA) */
  .navbar-captain {
    padding-top: max(0.45rem, env(safe-area-inset-top));
  }
}

@media (max-width: 480px) {
  /* Brand: logo only (frees ~90px) */
  #public-navbar a[onclick*="landing"] span[data-i18n="brandName"],
  #app-back-nav a[onclick*="landing"] span[data-i18n="brandName"] {
    display: none !important;
  }
  #public-navbar .brand-logo-img,
  #app-back-nav img {
    max-height: 32px !important;
    width: auto;
  }
  /* Icon-only pills with 40px tap targets; text spans stay in DOM for i18n */
  #public-navbar #login-nav-btn,
  #public-navbar #create-account-nav-btn,
  #app-back-nav #nav-logout-btn,
  .navbar-captain .btn[onclick*="setLanguage"] {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0 !important;
  }
  #public-navbar #login-nav-btn .bi,
  #public-navbar #create-account-nav-btn .bi,
  #app-back-nav #nav-logout-btn .bi,
  .navbar-captain .btn[onclick*="setLanguage"] .bi {
    font-size: 1rem !important;
    margin: 0 !important;
  }
  /* Bell + theme: same 40px rhythm (badge text untouched — no font-size reset) */
  #app-back-nav #nav-notif-btn,
  .navbar-captain .theme-toggle-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .navbar-captain .theme-toggle-btn {
    font-size: 1rem !important;
  }
  /* Restore glyphs hidden by the <=860px icon-strip rule */
  #public-navbar #login-nav-btn .me-1,
  #public-navbar #create-account-nav-btn .me-1 {
    display: inline-block !important;
  }
  /* Collapse the emptied public-links container (<576px links are hidden) */
  #public-navbar .public-nav-links {
    gap: 0 !important;
  }
  #public-navbar .public-nav-links:empty {
    display: none !important;
  }
}

@media (max-width: 380px) {
  #public-navbar .brand-logo-img,
  #app-back-nav img {
    max-height: 28px !important;
  }
}

/* ============================================================================
   ADMIN DASHBOARD SIZING & RESPONSIVE LAYOUT
   ============================================================================ */

#view-admin > .container-fluid {
  padding: 0;
  margin: 0;
  max-width: 100%;
}

#view-admin .row {
  margin: 0;
}

#view-admin .admin-sidebar {
  padding: 1rem 0.75rem;
  min-height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

#view-admin .col-lg-10.py-4.px-4 {
  padding: 1rem !important;
}

/* Admin stat cards responsive grid (4 columns desktop, 2 tablet, 1 mobile) */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

@media (max-width: 1200px) {
  .admin-stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .admin-stat-grid { grid-template-columns: 1fr; }
}

.admin-stat-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.2s;
  border-right: 4px solid #0d6efd;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.admin-stat-card.stat-danger  { border-right-color: #dc3545; }
.admin-stat-card.stat-success { border-right-color: #198754; }
.admin-stat-card.stat-warning { border-right-color: #ffc107; }
.admin-stat-card.stat-info    { border-right-color: #0dcaf0; }
.admin-stat-card.stat-dark    { border-right-color: #212529; }
.admin-stat-card.stat-purple  { border-right-color: #6f42c1; }
.admin-stat-card.stat-pink    { border-right-color: #d63384; }

.admin-stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.admin-stat-card small {
  color: #6c757d;
  font-size: 0.8rem;
  font-weight: 500;
}
.admin-stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 0.2rem 0 0;
}
.admin-stat-card .stat-sub {
  font-size: 0.75rem;
  color: #adb5bd;
  margin-top: 0.25rem;
}

/* Admin sidebar stacks to top on tablet/mobile instead of side */
@media (max-width: 991px) {
  #view-admin .admin-sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    padding: 0.75rem;
  }
  #view-admin .admin-sidebar nav.flex-column {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 4px;
  }
  #view-admin .admin-nav-link {
    flex: 1 1 calc(50% - 4px);
    margin: 0;
    min-width: 140px;
  }
}

/* Admin tables responsive horizontal scroll containers */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-table-wrap table {
  min-width: 720px;
  font-size: 0.9rem;
}
.admin-table-wrap td,
.admin-table-wrap th {
  white-space: nowrap;
  padding: 0.6rem 0.75rem !important;
}

/* ============================================================================
   PROFESSIONAL PASSENGER UI REDESIGN
   ============================================================================ */

.rider-home-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 0.75rem 1rem;
  position: relative;
}

.booking-card {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 10px 40px rgba(13, 110, 253, 0.12),
              0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.7);
  backdrop-filter: blur(10px);
  margin-top: -48px;
  position: relative;
  z-index: 100;
}

[data-theme='dark'] .booking-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.booking-locations {
  position: relative;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
}

.booking-loc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.booking-loc-row + .booking-loc-row::before {
  content: '';
  position: absolute;
  right: calc(50% - 1px);
  top: 24%;
  bottom: 24%;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #cbd5e1 0 4px, transparent 4px 8px);
}

html[dir="ltr"] .booking-loc-row + .booking-loc-row::before {
  left: 17px;
  right: auto;
}

.booking-loc-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
  z-index: 2;
}
.booking-loc-dot.dot-green {
  background: #dcfce7;
  color: #166534;
}
.booking-loc-dot.dot-red {
  background: #fee2e2;
  color: #991b1b;
}
[data-theme='dark'] .booking-loc-dot.dot-green { background: #064e3b; color: #86efac; }
[data-theme='dark'] .booking-loc-dot.dot-red { background: #7f1d1d; color: #fecaca; }

.booking-loc-input {
  flex: 1;
  position: relative;
}
.booking-loc-input input {
  width: 100%;
  border: none !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border-radius: 0 !important;
  padding: 0.5rem 2rem 0.5rem 0.25rem !important;
  background: transparent !important;
  font-weight: 600;
  font-size: 0.95rem;
}
html[dir="ltr"] .booking-loc-input input {
  padding: 0.5rem 0.25rem 0.5rem 2rem !important;
}
.booking-loc-input input:focus {
  outline: none !important;
  border-bottom-color: #0d6efd !important;
  box-shadow: none !important;
}
.booking-loc-input .locate-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #eff6ff;
  color: #0d6efd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
html[dir="ltr"] .booking-loc-input .locate-btn {
  left: 0;
  right: auto;
}
.booking-loc-input .locate-btn:hover { background: #dbeafe; }
.booking-loc-input .locate-btn.active {
  background: #0d6efd;
  color: #fff;
  animation: locatePulse 1.5s infinite;
}

@keyframes locatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(13, 110, 253, 0); }
}

/* Service Type Selector */
.service-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.service-option {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}
[data-theme='dark'] .service-option { background: #0f172a; border-color: #334155; }

.service-option:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}

.service-option.selected {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.15);
}
[data-theme='dark'] .service-option.selected {
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
}

.service-option .s-icon {
  font-size: 1.75rem;
  margin-bottom: 0.3rem;
  color: #64748b;
  display: block;
}
.service-option.selected .s-icon { color: #0d6efd; }

.service-option .s-name {
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
  color: #334155;
}
[data-theme='dark'] .service-option .s-name { color: #e2e8f0; }
.service-option.selected .s-name { color: #0d6efd; }

/* Service Fields */
.service-fields {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}
[data-theme='dark'] .service-fields { background: #1e293b; }

/* Vehicle Selector - Updated for 3 Options (Car + Scooter + Tricycle) */
.vehicle-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0 1.25rem;
}

.vehicle-selector.three-options {
  grid-template-columns: 1fr 1fr 1fr;
}

.vehicle-option {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}
[data-theme='dark'] .vehicle-option { background: #0f172a; border-color: #334155; }

.vehicle-option:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
}

.vehicle-option.selected {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.15);
}
[data-theme='dark'] .vehicle-option.selected {
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
}

.vehicle-option .v-icon {
  font-size: 2.25rem;
  margin-bottom: 0.4rem;
  color: #64748b;
  display: block;
}
.vehicle-option.selected .v-icon { color: #0d6efd; }

.vehicle-option .v-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.15rem;
  display: block;
}
.vehicle-option .v-fare {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}
.vehicle-option.selected .v-fare {
  color: #0d6efd;
  font-weight: 800;
}
.vehicle-option .v-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #198754;
  color: white;
  font-weight: 700;
}
html[dir="ltr"] .vehicle-option .v-tag {
  right: auto;
  left: 8px;
}

/* Zone badge & pricing-mode indicator */
.zone-status-banner {
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.zone-status-banner.zone-inside {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.zone-status-banner.zone-outside {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
[data-theme='dark'] .zone-status-banner.zone-inside { background: #052e16; color: #86efac; border-color: #14532d; }
[data-theme='dark'] .zone-status-banner.zone-outside { background: #422006; color: #fcd34d; border-color: #78350f; }

/* Primary CTA Button (enhanced) */
.btn-request-ride {
  width: 100%;
  padding: 1rem 1.25rem;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.35);
  border: none;
  color: white;
  transition: all 0.2s;
}
.btn-request-ride:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.45);
}
.btn-request-ride:disabled {
  background: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

/* Quick destination chips */
.quick-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.quick-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: #475569;
}
[data-theme='dark'] .quick-chip { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.quick-chip:hover { background: #dbeafe; color: #0d6efd; border-color: #93c5fd; }

/* ============================================================================
   DARK / LIGHT MODE ENHANCEMENTS
   ============================================================================ */

/* System preference detection combined with saved theme */
html[data-theme='light'] body { background-color: #f8fafc !important; }
html[data-theme='dark'] body  { background-color: #0f172a !important; color: #e2e8f0 !important; }

html[data-theme='dark'] .booking-loc-input input {
  color: #e2e8f0 !important;
  border-bottom-color: #334155 !important;
}

html[data-theme='dark'] .admin-stat-card {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme='dark'] .admin-stat-card small {
  color: #94a3b8;
}

/* Bootstrap primary-button text always white regardless of theme */
.btn-primary { color: #ffffff !important; }

/* ============================================================================
   GLOBAL RESPONSIVE GUARANTEES
   ============================================================================ */

* { max-width: 100vw; }

body, html {
  overflow-x: hidden;
}

/* Fix any inline widths that break responsiveness */
img, svg, iframe, video { max-width: 100%; }

/* ============================================================================
   PWA & MOBILE APP FEEL
   ============================================================================ */

/* Prevent tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Safe-area insets for notched phones */
@supports (padding: max(0px)) {
  .navbar-captain,
  .bottom-sheet,
  #app-back-nav {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }
  .bottom-sheet {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Standalone PWA app style tweaks */
@media all and (display-mode: standalone) {
  #app-splash-screen { display: none !important; }
  .navbar-captain { padding-top: calc(env(safe-area-inset-top, 0) + 0.6rem); }
  body { padding-top: env(safe-area-inset-top, 0); }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .navbar-captain,
  .bottom-sheet,
  .map-container,
  .btn {
    display: none !important;
  }
  
  .card-custom {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* ============================================================================
   FOLDABLE / DUAL-SCREEN SPECIFIC MEDIA QUERIES
   ============================================================================ */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body {
  padding-top: var(--safe-top);
  padding-bottom: calc(56px + var(--safe-bottom));
}

@media (spanning: single-fold-vertical) {
  .container,
  .container-fluid,
  .card-custom {
    max-width: calc(50vw - 2rem);
  }

  .full-screen-map {
    height: 100vh;
  }

  .map-container,
  #rider-map,
  #driver-map {
    height: calc(50vh - 80px);
  }

  .navbar-captain,
  .admin-sidebar,
  .mobile-tabbar {
    margin-left: 12px;
    margin-right: 12px;
  }

  .hinge-margin {
    margin-left: 12px;
    margin-right: 12px;
  }

  .admin-sidebar {
    max-width: calc(50vw - 2rem);
  }
}

@media (spanning: single-fold-horizontal) {
  .container,
  .container-fluid,
  .card-custom {
    max-width: calc(100vw - 2rem);
  }

  .full-screen-map {
    height: 50vh;
  }

  .map-container,
  #rider-map,
  #driver-map {
    height: calc(50vh - 80px);
  }

  .navbar-captain,
  .admin-sidebar,
  .mobile-tabbar {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .hinge-margin {
    margin-top: 12px;
    margin-bottom: 12px;
  }
}

/* ============================================================================
   COMPREHENSIVE TABLET RESPONSIVE (768px - 1023px)
   ============================================================================ */

@media (min-width: 768px) and (max-width: 1023px) {
  .card-custom {
    width: 100%;
    padding: 1rem;
    margin-left: 0;
    margin-right: 0;
  }

  .hero-section {
    padding: 2rem 1rem;
  }

  .full-screen-map {
    height: 50vh;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .booking-card {
    margin-top: -32px;
    padding: 1rem;
  }

  .account-choice-card {
    padding: 1.25rem;
    min-height: 140px;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .vehicle-option {
    padding: 0.85rem 0.6rem;
  }

  .vehicle-option .v-icon {
    font-size: 1.85rem;
  }

  .bottom-sheet {
    width: 90%;
    max-width: 600px;
    padding: 1rem;
  }
}

/* ============================================================================
   COMPREHENSIVE MOBILE RESPONSIVE (<= 767px)
   ============================================================================ */

@media (max-width: 767px) {
  .container {
    padding: 0.5rem !important;
  }

  .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .card-custom {
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 0.75rem;
  }

  .btn {
    min-height: 48px;
    font-size: 1rem;
    padding: 0.65rem 1rem;
  }

  .btn-lg {
    min-height: 52px;
    padding: 0.75rem 1.25rem;
  }

  .form-control,
  .form-select {
    min-height: 48px;
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
  }

  .hero-section {
    padding: 2rem 0.75rem 2rem 0.75rem;
  }

  .hero-section h1,
  .hero-title {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero-subtitle,
  .hero-sub {
    font-size: 0.9rem;
  }

  .full-screen-map {
    height: 55vh;
  }

  .price-pill {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-height: 40px;
  }

  .account-choice-card {
    min-height: 120px;
    margin: 0.5rem 0;
    padding: 1rem;
  }

  .account-choice-card i {
    font-size: 2rem;
  }

  .sidebar,
  .admin-sidebar.desktop-sidebar,
  .desktop-menu {
    display: none !important;
  }

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

  .admin-stat-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .history-list-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-list-card .history-image {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .history-list-card .history-content {
    width: 100%;
  }

  .vehicle-selector {
    gap: 0.5rem;
  }

  .vehicle-option {
    padding: 0.75rem 0.5rem;
  }

  .vehicle-option .v-icon {
    font-size: 1.75rem;
  }

  .vehicle-option .v-name {
    font-size: 0.9rem;
  }

  .vehicle-option .v-fare {
    font-size: 0.75rem;
  }

  .booking-card {
    margin-top: -24px;
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
  }

  .booking-locations {
    margin-bottom: 0.85rem;
  }

  .booking-loc-row {
    gap: 0.5rem;
    padding: 0.35rem 0;
  }

  .booking-loc-dot {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .booking-loc-input input {
    font-size: 0.9rem;
    padding: 0.4rem 1.75rem 0.4rem 0.2rem !important;
  }

  html[dir="ltr"] .booking-loc-input input {
    padding: 0.4rem 0.2rem 0.4rem 1.75rem !important;
  }

  .quick-chips {
    gap: 0.35rem;
  }

  .quick-chip {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .btn-request-ride {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-radius: 14px;
    min-height: 52px;
  }

  .zone-status-banner {
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .pwa-banner {
    display: none;
  }

  .pwa-banner.mobile-show-small {
    display: flex;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .rider-home-container {
    padding: 0 0.5rem 4.5rem;
  }

  .bottom-sheet {
    width: 94%;
    padding: 0.85rem;
    bottom: 72px;
    border-radius: 16px;
  }

  .mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
  }

  .mobile-tabbar .tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.25rem;
    min-height: 56px;
    min-width: 44px;
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .mobile-tabbar .tabbar-item i {
    font-size: 1.3rem;
    margin-bottom: 0.15rem;
  }

  .mobile-tabbar .tabbar-item span {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
  }

  .mobile-tabbar .tabbar-item.active {
    color: var(--primary-blue, #0d6efd);
  }

  .mobile-tabbar .tabbar-item.active i {
    transform: translateY(-1px);
  }

  .admin-stat-card {
    padding: 0.75rem 0.85rem;
  }

  .admin-stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: 0.35rem;
  }

  .admin-stat-card .stat-value {
    font-size: 1.35rem;
  }

  .navbar-collapse-sidebar-show-mobile {
    display: flex;
    flex-direction: column;
  }

  .rider-home-container,
  .dashboard-main-content {
    padding-bottom: 80px;
  }
}

@media (min-width: 768px) {
  .mobile-tabbar {
    display: none !important;
  }
}

/* ============================================================================
   DESKTOP RESPONSIVE (>= 1024px)
   ============================================================================ */

@media (min-width: 1024px) {
  .container,
  .container-fluid {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }

  .card-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(11, 15, 25, 0.12);
  }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .hero-section {
    padding: 5rem 2rem 4.5rem 2rem;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .hero-sub {
    font-size: 1.15rem;
  }

  .rider-home-container {
    max-width: 620px;
  }

  .booking-card {
    margin-top: -56px;
    padding: 1.35rem 1.5rem;
  }

  .bottom-sheet {
    max-width: 520px;
    padding: 1.35rem;
  }

  .admin-sidebar {
    width: 260px;
  }
}

/* ============================================================================
   4K / UHD RESPONSIVE (>= 2000px)
   ============================================================================ */

@media (min-width: 2000px) {
  :root {
    font-size: 18px;
  }

  .container,
  .container-fluid {
    max-width: 1800px;
  }

  .card-custom {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem;
  }

  .hero-section {
    padding: 7rem 3rem 6rem 3rem;
  }

  .hero-title {
    font-size: 3.5rem;
  }

  .hero-sub {
    font-size: 1.4rem;
    max-width: 800px;
  }

  .rider-home-container {
    max-width: 760px;
  }

  .booking-card {
    padding: 2rem 2.25rem;
    border-radius: 28px;
  }

  .vehicle-option {
    padding: 1.5rem 1rem;
  }

  .vehicle-option .v-icon {
    font-size: 3rem;
  }

  .full-screen-map {
    height: calc(100vh - 80px);
  }

  .map-container {
    min-height: 600px;
  }

  .bottom-sheet {
    max-width: 680px;
    padding: 2rem;
  }

  .navbar-captain {
    padding: 1rem 2.5rem;
  }

  .brand-logo-img {
    max-height: 56px;
  }

  .admin-stat-grid {
    gap: 1.25rem;
  }

  .admin-stat-card {
    padding: 1.5rem 1.75rem;
  }

  .admin-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 1.75rem;
  }

  .admin-stat-card .stat-value {
    font-size: 2.25rem;
  }
}

/* ============================================================================
   UNIVERSAL TOUCH TARGET ENFORCEMENT
   ============================================================================ */

button,
a,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
select,
textarea,
.tabbar-item,
.locate-btn,
.vehicle-option,
.price-pill,
.quick-chip,
.account-choice-card,
.star-rating i,
.theme-toggle-btn {
  min-width: 44px;
  min-height: 44px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  transform: scale(1);
  margin: 0.5rem;
  cursor: pointer;
}

input[type="range"] {
  min-height: 44px;
  padding: 0.5rem 0;
}

/* ============================================================================
   FOLDABLE HINGE AVOIDANCE CLASS
   ============================================================================ */

.hinge-margin {
  margin-left: 0;
  margin-right: 0;
}

@media (spanning: single-fold-vertical) {
  .navbar-captain.hinge-margin,
  .admin-sidebar.hinge-margin,
  .sidebar.hinge-margin,
  .mobile-tabbar.hinge-margin,
  .card-custom.hinge-margin {
    margin-left: 12px;
    margin-right: 12px;
  }
}

/* ============================================================================
   LANDSCAPE MOBILE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 900px) and (orientation: landscape) {
  .full-screen-map {
    height: 45vh;
  }

  .hero-section {
    height: auto;
    padding: 1rem 0.75rem;
    min-height: auto;
  }

  .hero-section h1,
  .hero-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .hero-subtitle,
  .hero-sub {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .btn {
    min-height: 42px;
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
  }

  .btn-lg {
    min-height: 46px;
  }

  .btn-request-ride {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    min-height: 46px;
  }

  .form-control,
  .form-select {
    min-height: 42px;
    font-size: 0.9rem;
    padding: 0.45rem 0.7rem;
  }

  .booking-card {
    margin-top: -18px;
    padding: 0.65rem 0.85rem;
  }

  .card-custom {
    padding: 0.65rem;
    margin: 0.35rem 0;
  }

  .account-choice-card {
    min-height: 90px;
    padding: 0.75rem;
    margin: 0.35rem 0;
  }

  .account-choice-card i {
    font-size: 1.5rem;
  }

  .vehicle-option {
    padding: 0.5rem 0.35rem;
  }

  .vehicle-option .v-icon {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
  }

  .vehicle-option .v-name {
    font-size: 0.8rem;
  }

  .vehicle-option .v-fare {
    font-size: 0.7rem;
  }

  .map-container {
    min-height: 220px;
  }

  .bottom-sheet {
    width: 85%;
    padding: 0.65rem;
    bottom: 10px;
  }

  .mobile-tabbar {
    height: calc(48px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
  }

  .mobile-tabbar .tabbar-item {
    min-height: 48px;
  }

  .mobile-tabbar .tabbar-item i {
    font-size: 1.1rem;
  }

  .mobile-tabbar .tabbar-item span {
    font-size: 0.6rem;
  }
}

/* ============================================================================
   IOS SAFE AREA SUPPLEMENT (iOS 15+)
   ============================================================================ */

@supports (padding: env(safe-area-inset-top)) {
  .navbar-captain {
    padding-top: calc(0.6rem + var(--safe-top));
  }

  .mobile-tabbar {
    padding-bottom: var(--safe-bottom);
    height: calc(56px + var(--safe-bottom));
  }

  .bottom-sheet {
    margin-bottom: calc(10px + var(--safe-bottom));
  }

  .pwa-banner {
    padding-top: calc(10px + var(--safe-top));
  }

  .rider-home-container {
    padding-bottom: calc(1rem + var(--safe-bottom));
  }

  .app-view {
    min-height: calc(100vh - 65px - var(--safe-top));
  }
}

/* ============================================================================
   CUSTOM SCROLLBAR FOR MOBILE NAVBAR HORIZONTAL OVERFLOW
   ============================================================================ */

@media (max-width: 767px) {
  .navbar-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .navbar-scroll-x::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================================================
   PRODUCTION RESPONSIVE POLISH — FINAL PASS (ALL DEVICES)
   ============================================================================ */

/* 4-Column Vehicle Selector Grid */
.vehicle-selector-four {
  grid-template-columns: repeat(4, 1fr) !important;
}

@media (max-width: 768px) {
  .vehicle-selector-four {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .vehicle-selector-four {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  .vehicle-option {
    padding: 0.6rem 0.4rem !important;
  }
  .vehicle-option .v-icon {
    font-size: 1.5rem !important;
  }
  .vehicle-option .v-name {
    font-size: 0.8rem !important;
  }
}

/* Notification Panel Drawer */
.notification-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 1060;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notification-panel.open {
  right: 0;
}

.notif-panel-header {
  padding: 1.25rem;
  background: var(--hero-gradient);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.notif-panel-footer {
  padding: 1rem;
  background: var(--bg-secondary);
}

.notif-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 1050;
}

.notif-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  cursor: pointer;
}

.notif-item.unread {
  border-right: 4px solid var(--primary-blue);
  background: var(--bg-card);
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.notif-content {
  flex: 1;
}

.notif-title {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.notif-text {
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (max-width: 480px) {
  .notification-panel {
    width: 100%;
    right: -100%;
  }
}

/* --- 1. Service + Vehicle Selector Grid Responsiveness --- */
@media (max-width: 640px) {
  .service-selector { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .vehicle-selector { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .vehicle-selector.three-options { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .service-selector { grid-template-columns: 1fr; }
  .vehicle-selector { grid-template-columns: 1fr; }
  .vehicle-selector.three-options { grid-template-columns: 1fr; }
  .service-option { padding: 0.6rem 0.4rem; }
  .service-option .s-icon { font-size: 1.35rem; margin-bottom: 0.15rem; }
  .service-option .s-name { font-size: 0.8rem; }
  .vehicle-option { padding: 0.75rem 0.5rem; }
  .vehicle-option .v-icon { font-size: 1.6rem; }
  .vehicle-option .v-name { font-size: 0.9rem; }
  .vehicle-option .v-fare { font-size: 0.78rem; }
}

/* --- 2. Admin Dashboard: stat cards + sidebar + tables tighter on small --- */
@media (max-width: 1200px) {
  .admin-stat-grid { gap: 0.75rem; }
}
@media (max-width: 600px) {
  .admin-stat-card { padding: 0.75rem 0.85rem; border-radius: 12px; border-right-width: 3px; }
  .admin-stat-card .stat-icon { width: 36px; height: 36px; font-size: 1rem; margin-bottom: 0.35rem; border-radius: 8px; }
  .admin-stat-card .stat-value { font-size: 1.3rem; }
  .admin-stat-card small { font-size: 0.75rem; }
  .admin-stat-card .stat-sub { font-size: 0.7rem; }
}
@media (max-width: 380px) {
  .admin-stat-grid { gap: 0.5rem; }
  .admin-stat-card { padding: 0.6rem 0.7rem; border-radius: 10px; }
  .admin-stat-card .stat-value { font-size: 1.15rem; font-weight: 700; }
}

/* Admin table wrap: always scrollable when needed */
.admin-table-wrap {
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
@media (max-width: 767px) {
  .admin-table-wrap table { min-width: 620px; font-size: 0.82rem; }
  .admin-table-wrap td, .admin-table-wrap th { padding: 0.5rem 0.6rem !important; }
  .admin-table-wrap .btn { min-height: 36px; padding: 0.35rem 0.6rem; font-size: 0.82rem; }
}

/* Admin nav on smallest screens: 100% width buttons */
@media (max-width: 420px) {
  #view-admin .admin-nav-link { flex: 1 1 100%; min-width: 0; }
}

/* --- 3. Auth Views: containers not too wide on desktop --- */
.auth-container-max {
  max-width: 520px;
  margin: 0 auto;
}
@media (min-width: 992px) {
  .auth-view-wrapper { padding: 2rem 1rem; }
}
@media (max-width: 576px) {
  .auth-sub-view .card-custom { padding: 1.1rem; }
  .account-choice-card { padding: 1rem 0.85rem; }
  .account-choice-card i { font-size: 2rem; }
  .doc-upload-zone { padding: 1rem 0.75rem; }
  .doc-upload-zone i { font-size: 1.5rem; }
}

/* --- 4. Rider Booking Card: tighter on very small phones --- */
@media (max-width: 380px) {
  .booking-card { margin-top: -32px; padding: 0.9rem; border-radius: 18px; }
  .booking-loc-row { gap: 0.5rem; padding: 0.4rem 0; }
  .booking-loc-dot { width: 30px; height: 30px; font-size: 0.75rem; }
  .booking-loc-input input { font-size: 0.9rem; padding: 0.4rem 1.8rem 0.4rem 0.2rem !important; }
  .price-pill { font-size: 0.95rem; padding: 6px 12px; }
  .star-rating { gap: 4px; font-size: 1.5rem; }
}

/* --- 5. Driver Home Dashboard Card Grid Responsiveness --- */
.driver-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 767px) {
  .driver-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .driver-stat-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .driver-stat-grid .card-custom { padding: 0.7rem 0.8rem; }
  .driver-stat-grid h2, .driver-stat-grid h3, .driver-stat-grid h4 { font-size: 1.05rem; }
}

/* --- 6. Pending Approval Screen (Driver) Responsive --- */
.pending-screen-wrapper {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.pending-icon-huge {
  width: 120px; height: 120px; margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, #fff7ed, #fed7aa);
  color: #c2410c;
  animation: pulseSoft 2s infinite;
}
@keyframes pulseSoft {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(254, 215, 170, 0.6); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 15px rgba(254, 215, 170, 0); }
}
[data-theme='dark'] .pending-icon-huge {
  background: linear-gradient(135deg, #78350f, #92400e);
  color: #fcd34d;
}
@media (max-width: 480px) {
  .pending-screen-wrapper { padding: 1rem 0.75rem; }
  .pending-icon-huge { width: 90px; height: 90px; font-size: 2.5rem; margin-bottom: 1rem; }
}

/* Pending rejection box (rejected status) */
.pending-rejection-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}
[data-theme='dark'] .pending-rejection-box {
  background: #450a0a;
  border-color: #991b1b;
}

/* --- 7. Notifications list padding + date text wrap --- */
@media (max-width: 576px) {
  .notification-item { padding: 0.75rem 0.85rem; }
  .notification-item h6 { font-size: 0.9rem; }
  .notification-item p { font-size: 0.82rem; margin-bottom: 0.3rem; }
  .notification-item small { font-size: 0.7rem; }
}

/* --- 8. Filter + Action Toolbars wrap on mobile instead of horizontal overflow --- */
.toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.toolbar-wrap .btn,
.toolbar-wrap .form-select,
.toolbar-wrap .form-control {
  min-height: 40px;
  flex: 1 1 auto;
}
@media (max-width: 576px) {
  .toolbar-wrap { gap: 0.4rem; }
  .toolbar-wrap .btn,
  .toolbar-wrap .form-select,
  .toolbar-wrap .form-control {
    flex: 1 1 100%;
    width: 100%;
  }
  .toolbar-wrap .d-flex { flex-wrap: wrap; gap: 0.4rem; }
  .toolbar-wrap .d-flex > * { flex: 1 1 100%; }
}

/* --- 9. Buttons: prevent inline buttons from squeezing on small widths --- */
.btn { white-space: nowrap; }
.btn-group { flex-wrap: wrap; }
@media (max-width: 380px) {
  .btn { font-size: 0.85rem; padding: 0.45rem 0.8rem; min-height: 42px; }
  .btn-lg { font-size: 0.95rem; padding: 0.65rem 1rem; }
  .btn i { font-size: 0.95em; }
}

/* --- 10. Inputs on iOS/Safari: consistent sizing, no iOS zoom --- */
@supports (-webkit-touch-callout: none) {
  input, select, textarea { font-size: 16px !important; }
}

/* --- 11. Map container height dynamic per device --- */
@media (min-width: 1024px) {
  .full-screen-map { height: calc(100vh - 65px); }
  .map-container { min-height: 480px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .map-container { min-height: 380px; }
}
@media (max-width: 380px) {
  .map-container { min-height: 260px; }
  .full-screen-map { height: 55vh; }
}

/* --- 12. Hero padding adjustments per size --- */
@media (max-width: 991px) {
  .hero-section { padding: 3rem 1rem 3.5rem; }
}
@media (max-width: 576px) {
  .hero-section { padding: 2rem 0.85rem 3rem; }
}
@media (max-width: 380px) {
  .hero-section { padding: 1.5rem 0.75rem 2.5rem; }
  .hero-title { font-size: 1.5rem; margin-bottom: 0.75rem; }
  .hero-sub { font-size: 0.9rem; margin-bottom: 1.25rem; }
}

/* --- 13. Typography scaling for small screens --- */
@media (max-width: 380px) {
  h1 { font-size: 1.6rem !important; }
  h2 { font-size: 1.35rem !important; }
  h3 { font-size: 1.15rem !important; }
  h4 { font-size: 1.05rem !important; }
  h5 { font-size: 0.98rem !important; }
  h6 { font-size: 0.9rem !important; }
  .fs-4 { font-size: 1.05rem !important; }
  .fs-5 { font-size: 0.98rem !important; }
  .small, small { font-size: 0.78rem !important; }
}

/* --- 14. Safe area fallbacks for older browsers --- */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* --- 15. Final print/high-contrast cleanup + no horizontal bleed guard --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
.app-view, section, .container, .container-fluid, .row, .col,
div[class*="col-"], header, nav, main, footer {
  max-width: 100%;
}

/* ============================================================================
   EMERGENCY RESPONSIVE + LAYOUT FIXES (2026-08-01)
   Fix Admin double-scrollbar, role viewport sizing, Driver/Rider nav wrapping
   ============================================================================ */

/* 1) Admin viewport: no double scrollbars — sidebar sticky, content natural flow */
#view-admin {
  min-height: calc(100vh - 65px);
  height: auto;
  overflow: visible;
}
#view-admin > .container-fluid {
  height: auto !important;
  display: block;
}
#view-admin > .container-fluid > .row {
  min-height: calc(100vh - 65px);
  align-items: stretch;
  flex-wrap: nowrap;
}
#view-admin .admin-sidebar {
  height: auto;
  min-height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
  flex-shrink: 0;
}
#view-admin .admin-content-col {
  overflow-y: visible;
  overflow-x: hidden;
  height: auto;
  min-height: calc(100vh - 65px);
  padding: 1.25rem 1rem 3rem !important;
}

/* On tablet/mobile: admin row wraps naturally, no sticky, no forced height */
@media (max-width: 991px) {
  #view-admin > .container-fluid > .row {
    flex-wrap: wrap;
  }
  #view-admin .admin-sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 0.75rem;
  }
  #view-admin .admin-content-col {
    padding: 1rem 0.5rem 2rem !important;
    min-height: auto;
  }
}

/* 2) Rider + Driver top sub-nav: force wrap + scroll-x if too cramped */
#view-rider > div:first-child,
#view-driver > div:first-child {
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem !important;
  min-height: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#view-rider > div:first-child .btn-group,
#view-driver > div:first-child .btn-group {
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: max-content;
}
#view-rider .btn-group .btn,
#view-driver .btn-group .btn {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  min-height: 40px;
}
@media (max-width: 576px) {
  #view-rider > div:first-child,
  #view-driver > div:first-child {
    justify-content: space-between;
  }
  #view-rider > div:first-child .badge,
  #view-driver > div:first-child .badge {
    order: -1;
    width: 100%;
    text-align: center;
    margin-bottom: 0.35rem;
  }
  #view-rider > div:first-child .btn-group,
  #view-driver > div:first-child .btn-group {
    width: 100%;
    justify-content: center;
  }
}

/* 3) App-view height: never scroll internal, let the page be the scroll container */
.app-view {
  overflow: visible !important;
  overflow-x: hidden !important;
  min-height: calc(100vh - 65px);
  height: auto;
}
.app-view > *:last-child {
  padding-bottom: 2rem;
}

/* 4) Landing nav: always visible links, correct spacing */
#public-navbar .public-nav-links {
  display: inline-flex !important;
}
@media (max-width: 575px) {
  #public-navbar .public-nav-links a {
    display: none;
  }
  #login-nav-btn, #create-account-nav-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
  }
  #public-navbar .brand-logo-img {
    max-height: 40px;
  }
}

/* 5) Booking card: always fully visible — no clipping, no overflow scrolls */
.rider-home-container {
  padding: 0 0.75rem 1.5rem;
}
.booking-card {
  max-height: none;
  overflow: visible;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.18);
  position: relative;
  z-index: 5;
}
@media (max-width: 480px) {
  .booking-card {
    padding: 1rem 0.9rem !important;
    border-radius: 16px;
  }
  .quick-chips {
    gap: 6px;
  }
  .quick-chip {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
}

/* 6) Tables: fix oversized column width bleed */
table td, table th {
  word-break: break-word;
  vertical-align: middle;
}
.table thead th {
  white-space: nowrap;
}

/* 7) Driver dashboard map: ensure it fits viewport on all heights */
#driver-map,
#rider-map {
  min-height: 320px;
  width: 100%;
  border-radius: 14px;
}
@media (min-height: 800px) {
  #driver-map { min-height: 420px; }
}

/* 8) No internal scrollbars on dashboard cards */
.card-custom, .card {
  overflow: visible;
}
#admin-stat-cards-scroll-fix {
  overflow: visible;
}

/* 9) Buttons: text-wrap for long CTA on very small screens */
.btn {
  white-space: normal !important;
  line-height: 1.25;
}

/* 10) Foldable: ensure no hinge overlap bleed on dual-pane layout */
@media (spanning: single-fold-vertical) {
  #view-admin > .container-fluid > .row {
    flex-wrap: wrap;
  }
  #view-admin .admin-sidebar,
  #view-admin .admin-content-col {
    width: calc(50vw - 12px) !important;
    flex: 0 0 auto !important;
  }
}

/* 11) Fix pending screen: never show internal scrollbar, center content */
#driver-sub-pending,
.auth-sub-view {
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.row { margin-left: 0; margin-right: 0; }
.row > .col, .row > [class*="col-"] { padding-left: 0.75rem; padding-right: 0.75rem; }

/* Dark mode stat-card border colours retained */
html[data-theme='dark'] .admin-stat-card { border-color: #334155; }

/* ============================================================================
   FINAL PRODUCTION FIXES — 2026-08-02
   1. Home page visibility (no hover-dependent content)
   2. Responsive dashboard improvements
   3. PWA polish
   ============================================================================ */

/* ---- VISIBILITY: Ensure ALL content is visible without hover ---- */

/* Hero section: always-on text rendering */
.hero-section,
.hero-section .row,
.hero-section .col-lg-7,
.hero-section .col-lg-5 {
  position: relative;
  z-index: 1;
}

/* Ensure the landing section is always visible and not dimmed */
#view-landing.active-view .hero-section,
#view-landing.active-view .hero-section * {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Remove hover-only color transitions that make text seem invisible */
.text-white-50 {
  /* Override Bootstrap's 50% opacity that can look invisible on some monitors */
  color: rgba(255, 255, 255, 0.80) !important;
}

/* Public navbar links: always readable */
#public-navbar .public-nav-links a {
  color: rgba(255,255,255,0.82) !important;
  font-weight: 500;
  transition: color 0.15s ease;
}
#public-navbar .public-nav-links a:hover {
  color: #ffffff !important;
}

/* Navbar buttons always visible */
#login-nav-btn,
#create-account-nav-btn {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ---- PWA: Standalone app chrome improvements ---- */
@media all and (display-mode: standalone) {
  /* Don't hide splash in standalone — it handles itself */
  body {
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Prevent text selection in app mode (feels native) */
  .navbar-captain, .mobile-tabbar, .booking-card {
    user-select: none;
    -webkit-user-select: none;
  }

  /* Allow selection in inputs and text content areas */
  input, textarea, p, h1, h2, h3, h4, h5, h6, span, small, .card-custom {
    user-select: text;
    -webkit-user-select: text;
  }
}

/* ---- DASHBOARD SIZING: Fix container widths on large screens ---- */
/* Admin content area: proper max-width constraint */
#view-admin .admin-content-col {
  max-width: 100%;
  overflow-x: hidden;
}

/* Admin stat grid: force consistent card heights */
.admin-stat-card {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Rider interface: proper full-screen map handling */
#rider-sub-home {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
}

#rider-map {
  flex: 1;
}

/* Driver dashboard: better card proportions */
#driver-sub-home .card-custom {
  min-height: 80px;
}

/* ---- FORMS: Better spacing on all screen sizes ---- */
.auth-sub-view .card-custom {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Ensure form inputs in auth never overflow their container */
.auth-sub-view .form-control,
.auth-sub-view .form-select {
  max-width: 100%;
}

/* ---- LOADING STATES: Spinner-like placeholders for dynamic content ---- */
.content-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text-muted, #adb5bd);
  flex-direction: column;
  gap: 0.5rem;
}

/* ---- BUTTONS: Consistent sizing and always-readable labels ---- */
.btn-request-ride {
  /* Force text visible regardless of gradient */
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning {
  /* Prevent text from becoming invisible due to theme overrides */
  color: #ffffff !important;
}

.btn-warning {
  color: #212529 !important;
}

.btn-outline-light {
  color: rgba(255,255,255,0.92) !important;
  border-color: rgba(255,255,255,0.5) !important;
}

.btn-outline-light:hover {
  color: #212529 !important;
  background-color: #ffffff !important;
}

/* ---- DARK MODE: Ensure stat cards are readable ---- */
[data-theme='dark'] .admin-stat-card .stat-value {
  color: #e2e8f0 !important;
}

[data-theme='dark'] .driver-stat-grid .card-custom h3,
[data-theme='dark'] .driver-stat-grid .card-custom h4 {
  color: #e2e8f0 !important;
}

/* ---- ACCESSIBILITY: Focus ring always visible ---- */
:focus-visible {
  outline: 3px solid #0d6efd !important;
  outline-offset: 2px !important;
}

/* ---- SCROLLBAR: Thin, minimal scrollbar for all panels ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100,116,139,0.7);
}

/* ---- SPLASH SCREEN: Smooth transition ---- */
#app-splash-screen {
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#app-splash-screen.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

/* ---- MOBILE BOTTOM PADDING: Account for mobile tabbar ---- */
@media (max-width: 767px) {
  .app-view > .container,
  .app-view > .container-fluid {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  #view-landing .hero-section {
    /* Ensure hero is never cut off on small screens */
    min-height: auto;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }
}

/* ---- TABLET IMPROVEMENTS ---- */
@media (min-width: 768px) and (max-width: 991px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #view-admin .admin-sidebar nav.flex-column {
    flex-direction: row !important;
    flex-wrap: wrap;
  }

  .booking-card {
    margin-top: -20px;
  }
}

/* ---- DESKTOP MAX-WIDTH CAP (prevent oversized layout on 4K) ---- */
@media (min-width: 1600px) {
  #view-rider .rider-home-container,
  #view-driver .container {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  #view-admin .container-fluid {
    max-width: 1800px;
  }
}

/* ---- PREVENT TEXT FROM BLEEDING OUTSIDE CONTAINERS ---- */
h1, h2, h3, h4, h5, h6, p, small, span, label {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---- CARD CUSTOM IN DARK MODE ---- */
[data-theme='dark'] .card-custom .text-dark {
  color: #e2e8f0 !important;
}

[data-theme='dark'] .card-custom .bg-light {
  background-color: #1e293b !important;
}

/* ---- PENDING SCREEN IMPROVEMENTS ---- */
#driver-sub-pending {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 130px);
}

/* ---- ADMIN PASSWORD FORM: Constrain width ---- */
#admin-sub-passwords .card-custom {
  max-width: 600px;
}

/* ---- OFFER SCREEN ANIMATION: Replace opacity animation with safe transform ---- */
#rider-sub-offer .card-custom {
  animation: slideUp 0.25s ease-out;
}

#driver-sub-request .card-custom {
  animation: slideUp 0.25s ease-out;
}

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

/* ============================================================================
   PRODUCTION FIXES — 2026-08-02
   Covers: logo sizing everywhere, map responsive, registration, admin, ride flow
   ============================================================================ */

/* ──────────────────────────────────────────────────
   1. LOGO: Strict size caps — NEVER stretch the logo
   ────────────────────────────────────────────────── */

/* Navbar brand logo — always small */
.brand-logo-img,
nav img[alt*="Captain"],
nav img[alt*="كابتن"],
#public-navbar img,
#app-back-nav img {
  max-height: 40px !important;
  max-width: 40px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Splash screen logo — medium centered */
.splash-logo {
  width: 110px !important;
  height: 110px !important;
  max-width: 110px !important;
  max-height: 110px !important;
  object-fit: contain;
}

/* Auth/login card logos */
.auth-sub-view img[alt*="Captain"],
.auth-sub-view img[alt*="كابتن"],
#auth-sub-login img,
#auth-sub-account-type img,
#auth-sub-rider-register img,
#auth-sub-driver-register img {
  max-width: 80px !important;
  max-height: 80px !important;
  height: auto !important;
  object-fit: contain;
}

/* Hero section logo (the big feature logo on landing page left column) */
.hero-section img[alt*="Captain"],
.hero-section img[alt*="كابتن"] {
  max-width: 88px !important;
  max-height: 88px !important;
  object-fit: contain;
}

/* Hero right-column card logo — small */
.hero-section .card-custom img {
  max-width: 65px !important;
  max-height: 65px !important;
  object-fit: contain;
}

/* Download section logo */
#download-section img {
  max-width: 72px !important;
  max-height: 72px !important;
  object-fit: contain;
}

/* Admin sidebar logo — tiny */
.admin-sidebar img,
#view-admin .admin-sidebar img {
  max-width: 34px !important;
  max-height: 34px !important;
  object-fit: contain;
}

/* Driver pending page card logo — medium */
#driver-sub-pending .card-custom img,
#driver-sub-pending img {
  max-width: 80px !important;
  max-height: 80px !important;
  width: 80px !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* PWA banner logo */
#pwa-install-banner img {
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
}

/* ──────────────────────────────────────────────────
   2. MAPS: Responsive sizing on all devices
   ────────────────────────────────────────────────── */

/* Rider fullscreen map — responsive height */
.full-screen-map {
  height: 55vh !important;
  min-height: 320px !important;
  max-height: 600px !important;
  width: 100% !important;
  border-radius: 0 !important;
}

/* On desktop, allow taller map */
@media (min-width: 992px) {
  .full-screen-map {
    height: 65vh !important;
    max-height: 700px !important;
  }
}

/* On small mobile, slightly shorter */
@media (max-width: 480px) {
  .full-screen-map {
    height: 42vh !important;
    min-height: 260px !important;
  }
}

/* Rider home container overlay on map */
.rider-home-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  pointer-events: none;
}

.rider-home-container .booking-card {
  pointer-events: all;
  background: var(--bg-primary, #ffffff);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem 0.75rem;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  max-height: 52vh;
  overflow-y: auto;
}

@media (max-width: 480px) {
  .rider-home-container .booking-card {
    padding: 0.85rem 0.85rem 0.5rem;
    max-height: 55vh;
    border-radius: 16px 16px 0 0;
  }
}

@media (min-width: 992px) {
  /* On desktop, show booking card as floating sidebar.
     :not(.d-none) is critical — bare #id would override Bootstrap's
     .d-none (both !important, ID wins) and force the home view visible
     on top of history/profile/settings with a 0-size map. */
  #rider-sub-home:not(.d-none) {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
  }

  .full-screen-map {
    flex: 1;
    height: calc(100vh - 120px) !important;
    max-height: none !important;
    border-radius: 0 !important;
    position: relative !important;
  }

  .rider-home-container {
    position: relative !important;
    width: 400px !important;
    flex-shrink: 0;
    bottom: auto;
    top: 0;
    height: calc(100vh - 120px);
    overflow-y: auto;
    border-radius: 0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  }

  .rider-home-container .booking-card {
    border-radius: 0 !important;
    height: 100%;
    max-height: none !important;
    overflow-y: auto;
    padding: 1.5rem;
  }
}

/* Driver map container */
#driver-sub-home .card-custom .card-custom,
#driver-sub-home > .row:last-child .card-custom {
  height: auto !important;
}

/* Driver map: responsive height */
#driver-map {
  width: 100% !important;
  border-radius: 12px !important;
  height: 320px !important;
}

@media (min-width: 768px) {
  #driver-map {
    height: 380px !important;
  }
}

@media (min-width: 1200px) {
  #driver-map {
    height: 440px !important;
  }
}

/* Admin zone map */
#admin-zone-map {
  width: 100% !important;
  border-radius: 12px !important;
}

/* ──────────────────────────────────────────────────
   3. ADMIN DASHBOARD: Fix layout + stat grid
   ────────────────────────────────────────────────── */

/* Admin stat grid — 4 columns on desktop, 2 on tablet, 1 on mobile */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 1199px) {
  .admin-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 479px) {
  .admin-stat-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

.admin-stat-card {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.admin-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.admin-stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary, #212529);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.admin-stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted, #6c757d);
}

/* Admin sidebar responsive */
.admin-sidebar {
  background: #0b0f19;
  min-height: calc(100vh - 65px);
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
}

@media (max-width: 767px) {
  /* On mobile, admin sidebar collapses to horizontal scroll row */
  #view-admin .row {
    flex-direction: column;
  }
  #view-admin .col-lg-2,
  #view-admin .col-md-3 {
    width: 100% !important;
    flex: none !important;
    max-width: 100% !important;
  }
  .admin-sidebar {
    min-height: auto;
    position: static;
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .admin-sidebar nav.nav.flex-column {
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 0.25rem;
    white-space: nowrap;
  }
  .admin-sidebar nav.nav.flex-column a {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
    flex-shrink: 0;
  }
  .admin-sidebar .d-flex {
    display: none !important;
  }
  #view-admin .col-lg-10,
  #view-admin .col-md-9 {
    width: 100% !important;
    flex: none !important;
    max-width: 100% !important;
    padding: 0.75rem !important;
  }
}

/* Admin content area */
.admin-content-col {
  overflow-x: auto;
  min-height: calc(100vh - 65px);
}

/* Admin tables — always scrollable on mobile */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ──────────────────────────────────────────────────
   4. DRIVER DASHBOARD: Cards and layout
   ────────────────────────────────────────────────── */

/* Driver stats cards — 4 across on desktop, 2x2 on mobile */
#driver-sub-home .row.g-3.mb-3:first-child {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

#driver-sub-home .row.g-3.mb-3:first-child > [class*="col-"] {
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 767px) {
  #driver-sub-home .row.g-3.mb-3:first-child {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 399px) {
  #driver-sub-home .row.g-3.mb-3:first-child {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* ──────────────────────────────────────────────────
   5. RIDER BOOKING CARD: Compact responsive layout
   ────────────────────────────────────────────────── */

/* Make booking elements compact so map stays visible */
.booking-card h5 { margin-bottom: 0.6rem !important; font-size: 1rem; }
.booking-card .zone-status-banner { margin-bottom: 0.5rem; padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.booking-card .booking-locations { margin-bottom: 0.5rem; }
.booking-card .quick-chips { margin-bottom: 0.5rem; }
.booking-card .service-selector { margin-bottom: 0.5rem; }
.booking-card .vehicle-selector { margin-bottom: 0.5rem; }

.vehicle-option {
  padding: 0.5rem 0.4rem;
  font-size: 0.82rem;
}

.vehicle-option .v-icon { font-size: 1.2rem; }
.vehicle-option .v-fare { font-size: 0.82rem; }

.service-option {
  padding: 0.4rem 0.6rem;
}

.btn-request-ride {
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  border-radius: 50px;
  width: 100%;
  background: linear-gradient(135deg, #0d6efd, #0056cc);
  color: #fff !important;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-request-ride:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-request-ride:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13,110,253,0.35);
}

/* Booking location inputs */
.booking-locations { display: flex; flex-direction: column; gap: 6px; }
.booking-loc-row { display: flex; align-items: center; gap: 8px; }
.booking-loc-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.85rem;
}
.dot-green { background: #d1fae5; color: #065f46; }
.dot-red { background: #fee2e2; color: #991b1b; }
.booking-loc-input { flex: 1; display: flex; align-items: center; gap: 6px; }
.booking-loc-input input {
  flex: 1; border: 1.5px solid #e2e8f0; border-radius: 50px;
  padding: 0.45rem 0.85rem; font-size: 0.88rem;
  background: var(--input-bg, #f8fafc); outline: none;
}
.booking-loc-input input:focus { border-color: #0d6efd; background: #fff; }
.locate-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f0f7ff; border: 1.5px solid #0d6efd; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0d6efd; font-size: 0.9rem; flex-shrink: 0;
  transition: all 0.2s;
}
.locate-btn:hover, .locate-btn.active { background: #0d6efd; color: #fff; }

/* Quick chips */
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-chip {
  background: #f0f7ff; border: 1px solid #cce5ff; border-radius: 50px;
  padding: 4px 12px; font-size: 0.8rem; cursor: pointer;
  color: #0d6efd; transition: all 0.15s;
}
.quick-chip:hover { background: #0d6efd; color: #fff; border-color: #0d6efd; }

/* Service & vehicle selectors */
.service-selector { display: flex; gap: 6px; }
.service-option {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 0.45rem; cursor: pointer; transition: all 0.2s; background: var(--bg-card, #fff);
}
.service-option.selected { border-color: #0d6efd; background: #f0f7ff; }
.s-icon { font-size: 1.3rem; color: #0d6efd; }
.s-name { font-size: 0.78rem; font-weight: 600; }

.vehicle-selector { display: flex; gap: 6px; }
.vehicle-option {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  padding: 0.5rem 0.3rem; cursor: pointer; transition: all 0.2s;
  background: var(--bg-card, #fff); position: relative;
}
.vehicle-option.selected { border-color: #0d6efd; background: #f0f7ff; }
.v-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: #0d6efd; color: #fff; font-size: 0.6rem; padding: 1px 6px;
  border-radius: 50px; white-space: nowrap; font-weight: 700;
}
.v-icon { font-size: 1.4rem; color: #0d6efd; }
.v-name { font-size: 0.78rem; font-weight: 600; }
.v-fare { font-size: 0.78rem; color: #6c757d; font-weight: 700; }

/* Zone status banner */
.zone-status-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 0.45rem 0.85rem; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
}
.zone-inside { background: #d1fae5; color: #065f46; }
.zone-outside { background: #fef3c7; color: #92400e; }

/* ──────────────────────────────────────────────────
   6. FULL RESPONSIVENESS: all pages
   ────────────────────────────────────────────────── */

/* Prevent any image from ever overflowing its container */
img {
  max-width: 100%;
  height: auto;
}

/* Global container overflow protection */
.container, .container-fluid {
  max-width: 100%;
  overflow-x: hidden;
}

/* Table overflow on small screens */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Driver nav bar — horizontal scroll on small screens */
#view-driver > div:first-child .btn-group {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#view-driver > div:first-child .btn-group::-webkit-scrollbar { display: none; }
#view-driver > div:first-child .btn-group .btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
}

/* Rider nav bar same */
#view-rider > div:first-child .btn-group {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#view-rider > div:first-child .btn-group::-webkit-scrollbar { display: none; }
#view-rider > div:first-child .btn-group .btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
}

/* ──────────────────────────────────────────────────
   7. DRIVER EARNINGS: Hide static demo chart
      (will be replaced with real data via JS)
   ────────────────────────────────────────────────── */

/* The static bar chart div has class earnings-chart, hide it */
.earnings-chart {
  display: none !important;
}

/* ──────────────────────────────────────────────────
   8. DRIVER PENDING PAGE: Clean centered layout
   ────────────────────────────────────────────────── */
#driver-sub-pending {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding: 2rem 1rem;
}

/* ──────────────────────────────────────────────────
   9. DARK MODE FIXES for all new elements
   ────────────────────────────────────────────────── */

[data-theme='dark'] .booking-card {
  background: #1e293b !important;
}

[data-theme='dark'] .booking-loc-input input {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

[data-theme='dark'] .service-option,
[data-theme='dark'] .vehicle-option {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme='dark'] .service-option.selected,
[data-theme='dark'] .vehicle-option.selected {
  background: #0f2044 !important;
  border-color: #0d6efd !important;
}

[data-theme='dark'] .admin-stat-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme='dark'] .admin-stat-card .stat-value {
  color: #e2e8f0 !important;
}

[data-theme='dark'] .quick-chip {
  background: #0f2044 !important;
  color: #93c5fd !important;
  border-color: #1e3a5f !important;
}

/* ── COUPON INPUT ─────────────────────────────────────────── */
#coupon-input {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.88rem;
}
#coupon-feedback.valid   { color: #16a34a; }
#coupon-feedback.invalid { color: #dc2626; }
#coupon-feedback.loading { color: #6c757d; }

/* Admin stat card value animation when number changes */
@keyframes statPop {
  0%   { transform: scale(1.0); }
  40%  { transform: scale(1.18); color: #0d6efd; }
  100% { transform: scale(1.0); }
}
.stat-value.updated {
  animation: statPop 0.45s ease-out;
}

/* ============================================================================
   ENHANCED: 4-Column Vehicle Grid, Notification Drawer, Price Pills
   ============================================================================ */

/* --- Notification Drawer RTL/LTR Compatibility --- */
html[dir="ltr"] .notification-panel {
  right: auto;
  left: -400px;
  box-shadow: 5px 0 25px rgba(0,0,0,0.15);
}
html[dir="ltr"] .notification-panel.open {
  right: auto;
  left: 0;
}
html[dir="ltr"] .notif-item.unread {
  border-right: none;
  border-left: 4px solid var(--primary-blue);
}
@media (max-width: 480px) {
  html[dir="ltr"] .notification-panel {
    left: -100%;
  }
  /* RTL (default Arabic) mobile rule: full-width drawer, hidden off the right edge */
  .notification-panel {
    width: 100vw;
    max-width: 380px;
    right: -100%;
  }
  html[dir="ltr"] .notification-panel {
    right: auto;
  }
}

/* Enhanced Notification Item Hover */
.notif-item:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
html[dir="ltr"] .notif-item:hover {
  transform: translateX(2px);
}
.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted, #adb5bd);
  margin-top: 0.3rem;
}

/* --- Enhanced Price Pill Styles --- */
.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--primary-blue, #0d6efd);
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  color: var(--primary-blue, #0d6efd);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 14px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
  user-select: none;
}
.price-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-blue, #0d6efd);
  opacity: 0;
  transition: opacity 0.22s;
}
.price-pill:hover, .price-pill.active {
  background: var(--primary-blue, #0d6efd);
  color: #ffffff;
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(13, 110, 253, 0.28);
  border-color: var(--primary-blue, #0d6efd);
}
.price-pill:active {
  transform: scale(0.98);
}

/* Price Pill Variants */
.price-pill.success {
  border-color: #16a34a;
  background: linear-gradient(135deg, #dcfce7 0%, #ffffff 100%);
  color: #16a34a;
}
.price-pill.success:hover, .price-pill.success.active {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.28);
  border-color: #16a34a;
}
.price-pill.warning {
  border-color: #d97706;
  background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
  color: #92400e;
}
.price-pill.warning:hover, .price-pill.warning.active {
  background: #d97706;
  color: #fff;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.28);
  border-color: #d97706;
}
.price-pill.danger {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
  color: #dc2626;
}
.price-pill.danger:hover, .price-pill.danger.active {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.28);
  border-color: #dc2626;
}

/* Price Pill Currency Icon */
.price-pill .pill-currency {
  font-size: 0.82em;
  opacity: 0.85;
}
.price-pill .pill-amount {
  letter-spacing: -0.01em;
}

/* ============================================================================
   GLOBAL FOOTER & ABOUT APP STYLES
   ============================================================================ */

/* ==========================================================================
   GLOBAL FOOTER — Premium Professional Redesign
   ========================================================================== */
.global-footer {
  background: linear-gradient(180deg, #0a0f1a 0%, #0d1525 40%, #08101e 100%);
  color: #94a3b8;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  padding: 0;
  clear: both;
}

/* Ambient glow blobs — subtle depth effect */
.global-footer::before,
.global-footer::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.04;
  filter: blur(60px);
}
.global-footer::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #0d6efd 0%, transparent 70%);
  top: -200px; left: -150px;
}
.global-footer::after {
  width: 450px; height: 450px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: -120px; right: -80px;
}

/* Top accent bar — thin, elegant gradient line */
.footer-glow-bar {
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    #0d6efd 15%,
    #06b6d4 35%,
    #10b981 55%,
    #f59e0b 75%,
    transparent 100%
  );
  width: 100%;
}

/* Main content row — 4-column professional grid */
.footer-main-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 2.5rem 2rem;
  padding: 3.5rem 0 2.5rem;
  position: relative;
  z-index: 1;
}

/* --- Brand column --- */
.footer-col-brand {
  max-width: 320px;
}

.footer-brand-block {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.footer-logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.footer-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(13, 110, 253, 0.4);
}
.footer-brand-name {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.footer-brand-tagline {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 2px;
  font-weight: 500;
}
.footer-desc {
  color: #7a8ba5;
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  max-width: 300px;
}

/* Social icons strip — modern circular design */
.footer-social-strip {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.footer-social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(148,163,184,0.06);
  border: 1.5px solid rgba(148,163,184,0.1);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.92rem;
}
.footer-social-icon:hover {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(13,110,253,0.35);
}
.footer-social-icon.footer-social-wa:hover  {
  background: #25d366;
  border-color: #25d366;
  box-shadow: 0 6px 16px rgba(37,211,102,0.35);
}
.footer-social-icon.footer-social-yt:hover  {
  background: #ff0000;
  border-color: #ff0000;
  box-shadow: 0 6px 16px rgba(255,0,0,0.3);
}

/* --- Column titles — clean underline accent --- */
.footer-col-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  position: relative;
  letter-spacing: 0.02em;
}
.footer-col-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 2.5px;
  background: linear-gradient(90deg, #0d6efd, #06b6d4);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.footer-col:hover .footer-col-title::after {
  width: 48px;
}
html[dir="ltr"] .footer-col-title::after { left: 0; right: auto; }

/* --- Nav links list — refined hover states --- */
.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-nav-list a {
  color: #8a9bb5;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.15rem 0;
  line-height: 1.6;
}
.footer-nav-list a i {
  font-size: 0.82rem;
  color: #3b4c63;
  transition: all 0.22s;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.footer-nav-list a:hover {
  color: #e2e8f0;
}
.footer-nav-list a:hover i {
  color: #0d6efd;
}
html[dir="rtl"] .footer-nav-list a:hover { padding-right: 6px; }
html[dir="ltr"] .footer-nav-list a:hover { padding-left: 6px; }

/* --- Contact list — clean card-like items --- */
.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #94a3b8;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-contact-list li:hover {
  color: #cbd5e1;
}
.footer-contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: rgba(13,110,253,0.1);
  color: #0d6efd;
  transition: all 0.22s;
}
.footer-contact-list li:hover .footer-contact-icon {
  transform: scale(1.08);
}
.footer-contact-icon--phone { background: rgba(16,185,129,0.1); color: #10b981; }
.footer-contact-icon--wa    { background: rgba(37,211,102,0.1);  color: #25d366; }
.footer-contact-icon--email { background: rgba(6,182,212,0.1);   color: #06b6d4; }
.footer-contact-icon--loc   { background: rgba(245,158,11,0.1);  color: #f59e0b; }
.footer-contact-list a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.footer-contact-list a:hover { color: #e2e8f0; }
.footer-phone-primary {
  font-size: 1.05rem;
  font-weight: 800;
  color: #10b981 !important;
  letter-spacing: -0.01em;
}

/* Bottom bar removed per user request */
.footer-divider, .footer-bottom-bar, .footer-copy, .footer-bottom-links, .footer-bottom-link { display: none !important; }

/* ============================================================================
   FOOTER BIDI + RESPONSIVE FIXES
   - .dir-ltr isolates phone numbers / e-mails / WhatsApp strings inside RTL
     context so they always render left-to-right (+20 109 300 2624, etc.)
   - Footer grid collapses 4 -> 2 -> 1 columns (start-aligned stack on phones)
   - Desktop (>=992px) untouched
   ============================================================================ */

/* Bi-directional isolation utility for Latin/number strings in RTL text */
.dir-ltr {
  direction: ltr !important;
  unicode-bidi: isolate;
}
span.dir-ltr, a.dir-ltr {
  display: inline-block;
}

/* Phone/WhatsApp numbers must never wrap mid-number; e-mails may break */
.footer-contact-list a[href^="tel:"],
.footer-contact-list a[href^="https://wa.me"] {
  white-space: nowrap;
}
.footer-contact-list a[href^="mailto:"] {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.footer-contact-list li {
  align-items: flex-start;
}
.footer-contact-list li .footer-contact-icon {
  margin-top: 1px;
}

/* Tablet: 2-column footer grid */
@media (max-width: 991.98px) {
  .footer-main-row {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
    padding: 2.5rem 0 2rem;
  }
  .footer-col-brand {
    max-width: none;
  }
  .footer-desc {
    max-width: none;
  }
}

/* Phones: start-aligned single-column stack */
@media (max-width: 575.98px) {
  .footer-main-row {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2rem 0 1.75rem;
  }
  .footer-col-brand {
    max-width: none;
  }
  .footer-brand-block {
    gap: 0.7rem;
    margin-bottom: 0.85rem;
  }
  .footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .footer-brand-name {
    font-size: 1.2rem;
  }
  .footer-brand-tagline {
    font-size: 0.78rem;
  }
  .footer-desc {
    font-size: 0.87rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    max-width: none;
  }
  .footer-social-strip {
    gap: 0.5rem;
  }
  .footer-social-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .footer-col-title {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }
  .footer-nav-list {
    gap: 0.5rem;
  }
  .footer-nav-list a {
    font-size: 0.88rem;
    gap: 0.55rem;
  }
  .footer-contact-list {
    gap: 0.75rem;
  }
  .footer-contact-list li {
    font-size: 0.88rem;
    gap: 0.65rem;
  }
  .footer-phone-primary {
    font-size: 1rem;
  }
}

/* Footer utility classes (kept for compatibility) */
.footer-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.5rem; }
.footer-brand-logo-mini { width: 32px; height: 32px; border-radius: 8px; }
.footer-bottom-link { color: #475569; text-decoration: none; font-size: 0.75rem; transition: color 0.2s; }
.footer-bottom-link:hover { color: #0d6efd; }

/* Eliminate awkward gap between landing page last section and footer */
#view-landing > #download-section,
#download-section {
  padding: 0 !important;
  margin-bottom: 0 !important;
  display: none !important;
}

/* About App Modal */
.about-modal-body {
  max-height: 65vh;
  overflow-y: auto;
  padding: 0;
}
.about-content-section {
  padding: 1.25rem 1.5rem;
  display: none;
}
.about-content-section.active {
  display: block;
  animation: fadeIn 0.28s ease;
}
.about-content-section h6 {
  color: #0d6efd;
  font-weight: 700;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}
.about-content-section p, .about-content-section li {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.65rem;
}
.about-content-section ul {
  padding-inline-start: 1.2rem;
}
.about-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary, #f1f5f9);
  padding: 4px;
  border-radius: 12px;
  margin: 0 1.5rem 1rem;
}
.about-tab {
  flex: 1;
  padding: 0.55rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s;
  min-height: auto;
}
.about-tab.active {
  background: #fff;
  color: #0d6efd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
[data-theme='dark'] .about-tabs {
  background: #0f172a;
}
[data-theme='dark'] .about-tab.active {
  background: #1e293b;
}

/* Complaints Form */
.complaint-type-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.complaint-type-chip {
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.7rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-card, #fff);
  color: var(--text-secondary, #475569);
}
.complaint-type-chip:hover {
  border-color: #0d6efd;
  color: #0d6efd;
}
.complaint-type-chip.selected {
  border-color: #0d6efd;
  background: #f0f7ff;
  color: #0d6efd;
}
[data-theme='dark'] .complaint-type-chip.selected {
  background: #1e3a5f;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .global-footer {
    padding: 2rem 1rem 1rem;
  }
  .complaint-type-row {
    grid-template-columns: 1fr 1fr;
  }
  .about-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .about-tabs::-webkit-scrollbar { display: none; }
  .about-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}
@media (max-width: 400px) {
  .complaint-type-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   FINAL SAFETY / BULLETPROOF OVERRIDES (prevents common bugs)
   ============================================================================ */

/* --- Notification Drawer Safety Net (prevents accidental inline flow rendering) ---
   Display is managed via inline style (HTML + JS), so we only lock: position, dimensions, z, visibility, transitions, directionality  */
html body #notification-panel.notification-panel,
#notification-panel {
  position: fixed !important;
  top: 0 !important;
  bottom: auto !important;
  right: -420px;
  width: 380px;
  height: 100vh !important;
  max-height: 100vh !important;
  flex-direction: column !important;
  opacity: 1 !important;
  visibility: hidden;
  overflow: hidden !important;
  z-index: 1060 !important;
  pointer-events: none;
  transition: right 0.3s ease;
}
html[dir="ltr"] body #notification-panel.notification-panel {
  right: auto;
  left: -420px;
  transition: left 0.3s ease;
}
html body #notification-panel.notification-panel.open {
  visibility: visible !important;
  pointer-events: auto;
  right: 0 !important;
}
html[dir="ltr"] body #notification-panel.notification-panel.open {
  right: auto !important;
  left: 0 !important;
}
@media (max-width: 480px) {
  html body #notification-panel.notification-panel {
    width: 100%;
    right: -100%;
  }
  html[dir="ltr"] body #notification-panel.notification-panel {
    right: auto;
    left: -100%;
  }
}

/* Prevent app-view sections hidden by default (only one visible at a time) */
.app-view:not(.active-view) {
  display: none !important;
}
.app-view.active-view {
  display: block !important;
}

/* Small mobile viewport safety */
@viewport {
  width: device-width;
}
html, body {
  overflow-x: hidden;
}
* {
  box-sizing: border-box;
}

/* ===== Autocomplete Search Results ===== */
.autocomplete-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-results.show {
  display: block;
  animation: slideDownFade 0.2s ease-out;
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.autocomplete-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-color, #f0f0f0);
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--table-hover, #f0f4ff);
}
.autocomplete-item .ac-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a73e8;
  font-size: 1rem;
}
.autocomplete-item .ac-text {
  flex: 1;
  min-width: 0;
}
.autocomplete-item .ac-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #212529);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autocomplete-item .ac-address {
  font-size: 0.78rem;
  color: var(--text-secondary, #6c757d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autocomplete-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 8px;
  color: var(--text-secondary, #6c757d);
  font-size: 0.85rem;
}
.autocomplete-loading .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}
.autocomplete-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-muted, #adb5bd);
  font-size: 0.85rem;
}

/* Route Info Bar */
.route-info-bar {
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 0.9rem;
}
[data-theme='dark'] .route-info-bar {
  background: linear-gradient(135deg, #1b3a26, #263238);
}
[data-theme='dark'] .autocomplete-item .ac-icon {
  background: linear-gradient(135deg, #1e3a5f, #263238);
  color: #64b5f6;
}

/* ===== Fare Estimation Panel ===== */
.fare-panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.fare-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 480px) {
  .fare-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
.fare-card {
  background: var(--bg-secondary, #f8f9fa);
  border: 2px solid var(--border-color, #dee2e6);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.fare-card:hover {
  border-color: #0d6efd;
  background: #e8f0fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13,110,253,0.15);
}
.fare-card.selected {
  border-color: #0d6efd;
  background: linear-gradient(135deg, #e8f0fe, #dbeafe);
  box-shadow: 0 4px 12px rgba(13,110,253,0.2);
}
.fare-card-icon { font-size: 1.4rem; }
.fare-card-name {
  font-size: 0.7rem;
  color: var(--text-secondary, #6c757d);
  font-weight: 600;
}
.fare-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary, #212529);
  line-height: 1;
}
.fare-card-unit { font-size: 0.65rem; color: var(--text-muted, #adb5bd); }
.fare-note { font-size: 0.75rem; color: var(--text-muted, #adb5bd); text-align: center; }

[data-theme='dark'] .fare-card {
  background: var(--bg-primary, #0f172a);
  border-color: var(--border-color, #334155);
}
[data-theme='dark'] .fare-card:hover,
[data-theme='dark'] .fare-card.selected {
  border-color: #3b82f6;
  background: #1e3a5f;
}
[data-theme='dark'] .fare-card-price { color: #e2e8f0; }
[data-theme='dark'] .fare-card-name { color: #94a3b8; }

/* Chip selected state */
.quick-chip.selected {
  background: linear-gradient(135deg, #0d6efd, #0a58ca);
  color: #fff;
  border-color: #0d6efd;
  box-shadow: 0 3px 10px rgba(13,110,253,0.35);
}

/* ── SERVICE OPTION: hide the icon inside each service card ── */
.service-option .s-icon {
  display: none !important;
}

/* ── Mobile & Responsive Optimizations for Trip Flow ── */
@media (max-width: 576px) {
  .card-custom {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }
  #driver-negotiate-wrap {
    padding: 0.75rem !important;
  }
  #driver-offer-price-input {
    font-size: 1.25rem !important;
    padding: 0.375rem 0.5rem !important;
  }
  #completed-trip-receipt {
    padding: 0.75rem !important;
    font-size: 0.9rem;
  }
  #completed-trip-receipt hr {
    margin: 0.5rem 0;
  }
  #driver-trip-map, #rider-active-map {
    min-height: 260px !important;
  }
  .driver-offer-pills {
    gap: 0.25rem !important;
  }
  .driver-offer-pill {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
  #driver-sub-active .fs-5, #rider-sub-active .fs-5 {
    font-size: 1.1rem !important;
  }
}

@media (max-width: 380px) {
  .card-custom {
    padding: 0.75rem !important;
  }
  #driver-negotiate-wrap .input-group {
    flex-direction: column;
  }
  #driver-negotiate-wrap .input-group > * {
    width: 100% !important;
    border-radius: 0.5rem !important;
    margin-bottom: 0.25rem;
  }
  #completed-trip-receipt {
    font-size: 0.82rem;
  }
}

/* ============================================================================
   DRIVER REQUEST COUNTDOWN PROGRESS BAR
   Very thin, sleek horizontal bar inside the driver's ride request card.
   White fill drains smoothly over the 60s dispatch timeout.
   ============================================================================ */
.driver-request-progress {
  display: block;
  height: 7px;
  min-height: 7px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #232a35;
  border: 1px solid #3a4353;
  overflow: hidden;
}
[data-theme='dark'] .driver-request-progress {
  background: #11161f;
  border-color: #2c3542;
}
.driver-request-progress-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #ffffff;
  transition: width 1s linear;
}
/* Active countdown state — plain subtle outline while the timer runs */
.driver-request-progress.active {
  border-color: #4b586c;
}
[data-theme='dark'] .driver-request-progress.active {
  border-color: #3a4657;
}
@media (prefers-reduced-motion: reduce) {
  .driver-request-progress-fill {
    transition: none;
  }
}

/* Active Rides persistent tab badge pulse (arrival countdown running) */
@keyframes activeRidePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.65; }
}
.pulse-badge {
  animation: activeRidePulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pulse-badge { animation: none; }
}
