/* ==========================================================================
   WPCab Location Autocomplete Stylesheet
   Desktop Dropdown & Mobile Fullscreen Modal Overlay (Exact Image 1 & 2 UI)
   ========================================================================== */

/* Ensure parent input wrappers are positioned relatively on desktop so in-page dropdowns align exactly */
.input-group,
.location-input-container,
.stop-input-wrap,
.from-group,
.to-group,
.location-input-wrap,
.search-field-wrap,
.picker-display {
  position: relative !important;
}

/* --- In-Page Desktop Dropdown Container (Matches exact input width) --- */
.autocomplete-dropdown,
.wpcab-location-dropdown {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  z-index: 999999 !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  display: none;
  padding: 8px 0 !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

/* --- Dynamic Body-Appended Dropdown Container (JS controlled top/left/width) --- */
.custom-autocomplete-dropdown {
  position: absolute !important;
  min-width: 0 !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  z-index: 999999 !important;
  max-height: 380px !important;
  overflow-y: auto !important;
  display: none;
  padding: 8px 0 !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

.autocomplete-dropdown.active,
.custom-autocomplete-dropdown.active,
.wpcab-location-dropdown.active {
  display: block !important;
}

/* Scrollbar Styling */
.autocomplete-dropdown::-webkit-scrollbar,
.custom-autocomplete-dropdown::-webkit-scrollbar,
.wpcab-mobile-location-modal .mobile-loc-body::-webkit-scrollbar {
  width: 5px;
}

.autocomplete-dropdown::-webkit-scrollbar-track,
.custom-autocomplete-dropdown::-webkit-scrollbar-track,
.wpcab-mobile-location-modal .mobile-loc-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb,
.custom-autocomplete-dropdown::-webkit-scrollbar-thumb,
.wpcab-mobile-location-modal .mobile-loc-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* --- Current Location Item (Purple Icon & Two Lines) --- */
.autocomplete-item.current-location-item,
.wpcab-current-loc-card {
  display: flex !important;
  align-items: center !important;
  padding: 12px 16px !important;
  cursor: pointer !important;
  background: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background-color 0.15s ease !important;
}

.autocomplete-item.current-location-item:hover,
.wpcab-current-loc-card:hover {
  background-color: #f8fafc !important;
}

.wpcab-current-loc-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.wpcab-current-loc-icon svg,
.wpcab-current-loc-icon i {
  width: 22px !important;
  height: 22px !important;
  color: #6d28d9 !important;
}

.wpcab-current-loc-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.wpcab-current-loc-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #6d28d9 !important;
  line-height: 1.3 !important;
}

.wpcab-current-loc-sub {
  font-size: 12px !important;
  color: #94a3b8 !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

/* --- Section Header (RECENT SEARCHES) --- */
.wpcab-autocomplete-section-header,
.mobile-loc-section-title {
  padding: 12px 16px 6px 16px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* --- Autocomplete Item Layout (Dark Main Title & Gray Subtitle) --- */
.autocomplete-item,
.mobile-loc-item {
  display: flex !important;
  align-items: center !important;
  padding: 10px 16px !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease !important;
  border-bottom: 1px solid #f8fafc !important;
  box-sizing: border-box !important;
}

.autocomplete-item:last-child,
.mobile-loc-item:last-child {
  border-bottom: none !important;
}

.autocomplete-item:hover,
.mobile-loc-item:hover {
  background-color: #f1f5f9 !important;
}

/* Icon Wrap */
.wpcab-loc-icon-wrap {
  width: 32px !important;
  height: 32px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.wpcab-loc-icon-wrap.city-type {
  background: #e0f2fe !important;
}

.wpcab-loc-icon-wrap.railway-type {
  background: #fee2e2 !important;
}

.wpcab-loc-icon-wrap.airport-type {
  background: #e0f2fe !important;
}

/* Item Text Info (Two Fields: Dark Title & Gray Subtitle) */
.wpcab-loc-item-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.wpcab-loc-main-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important; /* Dark bold text */
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.wpcab-loc-sub-title {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #64748b !important; /* Gray secondary text */
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Google Logo Footer */
.pac-logo {
  padding: 8px 16px !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
  text-align: right !important;
  background: #fafafa !important;
  border-top: 1px solid #f1f5f9 !important;
}

/* ==========================================================================
   MOBILE FULL-SCREEN POPUP MODAL (Exact Image 2 Design)
   Full Width & Full Height Overlay on Screens <= 768px
   ========================================================================== */
.wpcab-mobile-location-modal {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  background: #ffffff !important;
  z-index: 9999999 !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 768px) {
  /* Hide desktop dropdowns on mobile screens */
  .autocomplete-dropdown,
  .custom-autocomplete-dropdown,
  .wpcab-location-dropdown {
    display: none !important;
  }

  /* Show mobile full-screen popup modal when active */
  .wpcab-mobile-location-modal.active {
    display: flex !important;
  }
}

/* Mobile Modal Header */
.wpcab-mobile-location-modal .mobile-loc-header {
  display: flex !important;
  align-items: center !important;
  padding: 12px 16px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  gap: 12px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.wpcab-mobile-location-modal .mobile-loc-back-btn {
  background: none !important;
  border: none !important;
  font-size: 22px !important;
  color: #1e293b !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.wpcab-mobile-location-modal .mobile-loc-input-wrap {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
}

.wpcab-mobile-location-modal .mobile-loc-search-input {
  width: 100% !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
}

/* Mobile Modal Body */
.wpcab-mobile-location-modal .mobile-loc-body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 16px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.wpcab-mobile-location-modal .mobile-loc-current-card {
  display: flex !important;
  align-items: center !important;
  padding: 14px 20px !important;
  background: #ffffff !important;
  border-bottom: 8px solid #f1f5f9 !important;
  cursor: pointer !important;
}

/* ==========================================================================
   STANDARDIZED 15-MINUTE TIME SLOT DROPDOWN (Matches User Image 2 UI)
   ========================================================================== */
.custom-time-dropdown,
.wpcab-custom-time-dropdown {
  position: absolute !important;
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 6px 0 !important;
  z-index: 999999 !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  min-width: 160px !important;
  box-sizing: border-box !important;
  display: none;
  font-family: inherit !important;
}

.custom-time-dropdown li,
.wpcab-custom-time-dropdown li {
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
  text-align: left !important;
  list-style: none !important;
  margin: 0 !important;
  border-bottom: 1px solid #f8fafc !important;
}

.custom-time-dropdown li:last-child,
.wpcab-custom-time-dropdown li:last-child {
  border-bottom: none !important;
}

.custom-time-dropdown li:hover,
.wpcab-custom-time-dropdown li:hover {
  background-color: #f1f5f9 !important;
  color: #3b52e1 !important;
}

.custom-time-dropdown li.selected,
.wpcab-custom-time-dropdown li.selected {
  background-color: #eff6ff !important;
  color: #2563eb !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   FLATPICKR CALENDAR OVERRIDES (Matches User Image 1 UI)
   ========================================================================== */
.flatpickr-calendar {
  background: #ffffff !important;
  border-radius: 16px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  font-family: inherit !important;
  padding: 8px !important;
}

.flatpickr-calendar .flatpickr-months {
  align-items: center !important;
  margin-bottom: 8px !important;
}

.flatpickr-calendar .flatpickr-current-month {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

.flatpickr-calendar .flatpickr-weekday {
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}

.flatpickr-calendar .flatpickr-day {
  border-radius: 50% !important;
  color: #1e293b !important;
  font-weight: 500 !important;
}

.flatpickr-calendar .flatpickr-day.today {
  border-color: #3b52e1 !important;
  color: #3b52e1 !important;
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover {
  background: #3b52e1 !important;
  border-color: #3b52e1 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

