/* ====================================================================
   WASIL-ROUTES LOCATION MODAL - WASIL-DELIVERY DESIGN SYSTEM
   Issue #53: CSS-Only UI Upgrade
   
   Based on: wasil-delivery/assets/css/style.css
   Maintains: All existing jQuery selectors and functionality
   Modified: Visual styling only (colors, shadows, animations, layout)
==================================================================== */

:root {
  --w-red: #E30613;
  --w-green: #009640;
  --w-dark: #1F2125;
}

/* ====================================================================
   MODAL BACKDROP - Glassmorphism Design
==================================================================== */

.dvsl_modal {
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

/* ====================================================================
   MODAL CONTAINER - Modern iOS-Style Design
==================================================================== */

.dvsl_modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  width: 90%;
  max-width: 440px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  /* Fix text wrapping in modal */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dvsl_modal-content p {
  font-size: 12px;
  margin: 5px 0;
  color: #666;
}

/* Adjust modal padding since buttons are removed */
.dvsl_main_content {
  padding-bottom: 20px;
}

/* ====================================================================
   MODAL HEADER - Location Pin + Wasilonline Delivers to
==================================================================== */

.dvsl_modal_header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 25px 20px 10px;
}

.dvsl_modal_header .dvsl_location_pin_icon {
  margin-bottom: 8px;
}

.dvsl_modal_header h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1F2125;
  letter-spacing: -0.3px;
}

/* ====================================================================
   CLOSE BUTTON
==================================================================== */

.dvsl_close {
  color: #666;
  float: right;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: 15px;
  right: 20px;
  height: auto;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  z-index: 10;
}

.dvsl_close:hover,
.dvsl_close:focus {
  background: rgba(0, 0, 0, 0.05);
  color: #000;
  text-decoration: none;
}

/* ====================================================================
   SEARCH INPUT - iOS Style
==================================================================== */

.dvsl_modal input.dvsl_search {
  width: 100% !important;
  background: #F2F2F7 !important;
  display: block;
  border-radius: 12px !important;
  box-sizing: border-box;
  color: #000 !important;
  height: 48px;
  border: none !important;
  font-size: 16px;
  padding: 0 14px 0 44px !important;
  margin: 15px 20px;
  width: calc(100% - 40px) !important;
  outline: none !important;
  box-shadow: none !important;
  transition: background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 14px center !important;
}

.dvsl_modal input.dvsl_search:focus {
  background: #E8E8ED !important;
}

.dvsl_modal input.dvsl_search::placeholder {
  color: #999;
}

/* ====================================================================
   RESULTS LIST
   Updated: Hidden by default, shown on search
==================================================================== */

.dvsl_ul {
  display: none !important;
  /* Hidden by default */
  max-height: 300px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  text-align: left;
  background: #fff;
  list-style: none;
  border-radius: 8px;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dvsl_ul.dvsl_show_results {
  display: block !important;
  /* Show when searching */
}

/* No results message */
.dvsl_ul li.dvsl_no_results {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px;
  cursor: default;
  pointer-events: none;
}

/* Search result items from cross-state search */
.dvsl_ul li.dvsl_search_result {
  font-weight: 500;
}

.dvsl_ul li.dvsl_search_result.dvsl_menu_city {
  color: #333;
}

.dvsl_ul li.dvsl_search_result.dvsl_menu_city:hover {
  background: #f9f9f9;
  color: var(--w-red);
}

.dvsl_ul::-webkit-scrollbar {
  width: 6px;
}

.dvsl_ul::-webkit-scrollbar-track {
  background: #f9f9f9;
}

.dvsl_ul::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.dvsl_ul::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

/* ====================================================================
   LIST ITEMS
==================================================================== */

.dvsl_ul li {
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f9f9f9;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
  color: #000;
  font-size: 15px;
  /* Fix text wrapping in list items */
  white-space: normal;
  word-wrap: break-word;
}

.dvsl_ul li:last-child {
  border-bottom: none;
}

li.dvsl_menu_state.dvsl_menu_zone {
  padding-left: 20px !important;
  font-weight: 800;
  font-size: 16px;
  color: #000;
  pointer-events: none;
  background: #f9f9f9;
  padding: 12px 20px;
}

li.dvsl_menu_zone {
  color: #333;
  font-size: 15px;
  font-weight: 600;
}

.dvsl_ul li:not(.dvsl_active, .dvsl_select_location, .dvsl_menu_state):hover {
  background: #f9f9f9;
  color: var(--w-red);
}

.dvsl_ul li:not(.dvsl_active, .dvsl_select_location, .dvsl_menu_state):active {
  background: #f0f0f0;
}

.dvsl_ul .dvsl_active {
  background: rgba(227, 6, 19, 0.05);
  color: var(--w-red);
  font-weight: 600;
}

/* ====================================================================
   BUTTONS (HIDDEN)
   Buttons removed from HTML flow, ensuring CSS hides container 
==================================================================== */

.dvsl_location_buttons {
  display: none !important;
}

/* Keeping button styles in case needed later, but they won't show */
.dvsl_modal button.dvsl_ok {
  width: calc(100% - 40px) !important;
  margin: 20px !important;
  background: rgba(227, 6, 19, 0.9);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(227, 6, 19, 0.2);
  transition: all 0.2s;
}

.dvsl_modal button.dvsl_ok:hover {
  background: var(--w-red);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(227, 6, 19, 0.3);
}

.dvsl_modal button.dvsl_ok:active {
  transform: translateY(0);
}

button.dvsl_clr_btn {
  border-radius: 8px !important;
  padding: 8px 16px;
  float: right !important;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #333;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

button.dvsl_clr_btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ====================================================================
   LOADING STATE
==================================================================== */

.dvsl_front_loader {
  display: none;
  text-align: center;
  padding: 40px;
  color: #999;
}

.dvsl_front_loader.active {
  display: block;
}

/* ====================================================================
   ANIMATIONS
==================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px) scale(0.9);
    opacity: 0;
  }

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

/* ====================================================================
   UTILITY CLASSES
==================================================================== */

.dvsl_up {
  transform: rotate(180deg);
}

.dvsl_dropdown {
  position: relative;
  display: inline-block;
}

.dvsl_dropdown a:hover {
  background-color: #f9f9f9;
}

.dvsl_dropdown-content {
  position: absolute;
  background-color: #ffffff;
  min-width: 300px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  padding: 20px;
  border-radius: 15px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dvsl_dropdown-content a {
  color: #000;
  text-decoration: none;
  display: block;
  padding: 8px 0;
}

.dvsl_modal .dvsl_menu_block {
  display: none;
}

/* ====================================================================
   RESPONSIVE DESIGN - Mobile Optimized
==================================================================== */

@media only screen and (max-width: 1024px) {
  .dvsl_modal-content {
    width: 85%;
    max-width: 400px;
  }
}

@media only screen and (max-width: 768px) {
  .dvsl_modal-content {
    width: 90%;
    max-width: 380px;
  }

  .dvsl_ul {
    max-height: 50vh;
  }
}

@media only screen and (max-width: 540px) {
  .dvsl_modal-content {
    width: 92%;
    border-radius: 16px;
  }

  .dvsl_modal input.dvsl_search {
    height: 44px;
    font-size: 15px;
  }

  .dvsl_ul li {
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media only screen and (max-width: 450px) {
  .dvsl_modal-content {
    width: 94%;
    border-radius: 14px;
  }

  .dvsl_dropdown-content {
    min-width: 100%;
  }
}

@media only screen and (max-width: 320px) {
  .dvsl_modal-content {
    width: 96%;
  }

  .dvsl_ul li {
    font-size: 13px;
  }
}

/* ===============================
   PILL BUTTON - iOS Style
   =============================== */
.dvsl_location_pill {
  background: #FFFFFF !important;
  border: 1px solid #E5E5E5 !important;
  border-radius: 25px !important;
  /* THIS IS CRITICAL FOR PILL SHAPE */
  padding: 8px 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;

  /* Fix text wrapping */
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dvsl_location_pill:hover {
  background: #F9F9F9 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-1px);
}

.dvsl_location_pill .dvsl_location_text {
  font-weight: 600 !important;
  color: #E30613 !important;
  font-size: 14px !important;

  /* Updated for text wrapping */
  display: block;
  white-space: normal !important;
  /* Allow text to wrap */
  word-wrap: break-word;
  line-height: 1.4;
}

/* Remove dropdown arrow from pill button */
.dvsl_location_pill .dvsl_right {
  display: none !important;
}

.dvsl_location_pill .dvsl_left {
  width: 100% !important;
  padding: 0 !important;
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media only screen and (max-width: 768px) {
  .dvsl_location_pill {
    padding: 8px 16px !important;
    font-size: 13px;
  }
}

@media only screen and (max-width: 480px) {
  .dvsl_location_pill {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ===============================
   LABEL SELECTION MODAL
   =============================== */
.dvsl_label_modal .dvsl_modal-content {
  max-width: 400px !important;
  padding-bottom: 10px;
}

.dvsl_label_options {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 20px;
}

.dvsl_label_option {
  background: #FFFFFF;
  border: 2px solid #E5E5E5;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  flex: 1;
  min-width: 100px;
  max-width: 120px;
}

.dvsl_label_option:hover {
  background: #F9F9F9;
  border-color: #E30613;
  color: #E30613;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(227, 6, 19, 0.15);
}

.dvsl_label_option:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(227, 6, 19, 0.1);
}

.dvsl_label_skip {
  margin-top: 15px;
  background: transparent !important;
  border: none !important;
  color: #999 !important;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 8px 16px;
}

.dvsl_label_skip:hover {
  color: #666 !important;
  text-decoration: underline;
}

/* Label in pill button styling */
.dvsl_location_pill .dvsl_location_text {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Mobile responsive for label modal */
@media only screen and (max-width: 540px) {
  .dvsl_label_options {
    flex-direction: column;
    gap: 10px;
  }

  .dvsl_label_option {
    max-width: 100%;
    width: 100%;
  }
}