/**
 * Property Map & Distances Elementor Widget Styles
 */

.lgap-property-map-distances-widget {
  position: relative;
  width: 100%;
}

/* Section Header */
.lgap-map-header {
  /* display: flex; */
  /* align-items: center; */
  /* justify-content: space-between; */
  /* margin-bottom: 20px; */
  margin-bottom: 16px;
}
.lgap-map-header .lgap-section-title {
  margin-bottom: 0;
}

.lgap-section-title {
  font-family: "Playfair Display", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: #000;
  margin: 0;
  flex: 1;
}

/* Expand Button */
.lgap-expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  color: #000;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.lgap-expand-button:hover {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.lgap-expand-button:active {
  transform: translateY(0);
}

/* Map Container */
.lgap-map-container {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.lgap-property-map {
  width: 100%;
  height: 400px;
  background-color: #f5f5f5;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Leaflet Map Overrides */
.lgap-property-map .leaflet-container {
  font-family: "Josefin Sans", sans-serif;
  border-radius: 8px;
}

.lgap-property-map .leaflet-popup-content-wrapper {
  border-radius: 4px;
  font-family: "Josefin Sans", sans-serif;
}

.lgap-property-map .leaflet-popup-content {
  margin: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.lgap-property-map .leaflet-control-zoom {
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lgap-property-map .leaflet-control-zoom a {
  border-radius: 4px;
  font-family: "Josefin Sans", sans-serif;
  color: #333;
  background-color: #fff;
}

.lgap-property-map .leaflet-control-zoom a:hover {
  background-color: #f7f7f7;
}

/* Distances Section */
.lgap-distances-section {
  margin-top: 20px;
}

.lgap-distances-toggle {
  position: relative;
}

.lgap-distances-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 200px;
  padding: 8px 12px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Josefin Sans", sans-serif;
  font-size: 14px;
  color: #333;
}

.lgap-distances-button:hover {
  border-color: #ccc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lgap-distances-title {
  font-weight: 500;
  flex: 1;
  text-align: left;
}

.lgap-dropdown-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s ease;
  margin-left: 8px;
}

.lgap-distances-button[aria-expanded="true"] .lgap-dropdown-icon {
  transform: rotate(180deg);
}

/* Dropdown Content */
.lgap-distances-dropdown {
  min-width: 240px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  margin-top: 4px;
}

.lgap-distances-list {
  display: flex;
  flex-direction: column;
}

.lgap-distance-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 16px;
  font-family: "Josefin Sans", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #666;
  transition: background-color 0.2s ease;
}

.lgap-distance-item:hover {
  background-color: #f7f7f7;
}

.lgap-distance-name {
  flex: 1;
  font-weight: 500;
  color: #333;
}

.lgap-distance-separator {
  margin: 0 8px;
  color: #ccc;
}

.lgap-distance-value {
  font-weight: 600;
  color: #666;
}

.lgap-distance-place {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-left: 8px;
}

.lgap-no-distances {
  opacity: 0.7;
  font-style: italic;
  justify-content: center;
}

.lgap-distances-debug {
  border-radius: 4px;
  margin-top: 8px;
}

/* Placeholder for editor */
.lgap-map-distances-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background-color: #f7f7f7;
  border: 2px dashed #ddd;
  border-radius: 8px;
  color: #666;
  font-family: "Josefin Sans", sans-serif;
  text-align: center;
  padding: 20px;
}

/* Loading State */
.lgap-map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(245, 245, 245, 0.9);
  color: #666;
  font-family: "Josefin Sans", sans-serif;
  font-size: 14px;
  z-index: 1000;
}

.lgap-map-loading::after {
  content: "...";
  animation: lgap-loading-dots 1.5s infinite;
}

/* Map Fullscreen Mode */
.lgap-map-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
}

.lgap-map-fullscreen .lgap-property-map {
  height: 100vh !important;
  border-radius: 0 !important;
}

.lgap-map-fullscreen .lgap-expand-button {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background-color: rgba(255, 255, 255, 0.95);
}

.lgap-map-fullscreen .lgap-expand-button i::before {
  content: "\f066"; /* fa-compress-arrows-alt */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .lgap-section-title {
    font-size: 18px;
  }

  .lgap-property-map {
    height: 350px;
  }

  .lgap-expand-button {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .lgap-distances-section {
    margin-top: 16px;
  }

  .lgap-distances-dropdown {
    min-width: 220px;
  }

  .lgap-distance-item {
    padding: 6px 12px;
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .lgap-section-title {
    font-size: 16px;
  }

  .lgap-map-header {
    margin-bottom: 12px;
  }

  .lgap-property-map {
    height: 280px;
  }

  .lgap-expand-button {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .lgap-distances-section {
    margin-top: 12px;
  }

  .lgap-distances-button {
    font-size: 13px;
    padding: 6px 10px;
  }

  .lgap-distances-dropdown {
    min-width: 200px;
  }

  .lgap-distance-item {
    padding: 6px 12px;
    font-size: 12px;
  }

  .lgap-distance-separator {
    margin: 0 6px;
  }
}

/* Dark Mode Support */


/* Print Styles */
@media print {
  .lgap-property-map-distances-widget {
    break-inside: avoid;
  }

  .lgap-expand-button,
  .lgap-distances-section {
    display: none;
  }

  .lgap-property-map {
    height: 300px !important;
  }

  .lgap-section-title {
    color: #000 !important;
  }
}

/* Accessibility */
.lgap-expand-button:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.lgap-distances-button:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.lgap-distance-item:focus {
  outline: 1px solid #0073aa;
  outline-offset: -1px;
  background-color: rgba(0, 115, 170, 0.1);
}

/* Animation Keyframes */
@keyframes lgap-loading-dots {
  0%,
  20% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  80%,
  100% {
    opacity: 0;
  }
}

/* Map Marker Custom Styling */
.lgap-custom-marker {
  background-color: #ffb800;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.lgap-custom-marker::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #ffb800;
}

/* Enhanced UIKit Dropdown Styles */
.uk-dropdown.lgap-distances-dropdown {
  animation-duration: 0.2s;
}

.uk-dropdown.lgap-distances-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #e0e0e0;
}

.uk-dropdown.lgap-distances-dropdown::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 21px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #fff;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .lgap-expand-button,
  .lgap-distances-button {
    border-width: 2px;
  }

  .lgap-distances-dropdown {
    border-width: 2px;
  }

  .lgap-distance-item:hover {
    background-color: #000;
    color: #fff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .lgap-expand-button,
  .lgap-distances-button,
  .lgap-distance-item,
  .lgap-dropdown-icon {
    transition: none;
  }

  .lgap-loading-dots {
    animation: none;
  }

  .lgap-loading-dots::after {
    content: "";
  }
}
