/*
 * Leaflet Map Styling with Brand Colors
 *
 * This file contains custom styles for Leaflet maps to match the brand's color palette.
 * Brand Colors:
 * - Brand Yellow: #fde684ff
 * - Brand Dark Purple: #5212ffff
 */

/* Rotate hues to match our theme*/

@keyframes maps-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.leaflet-container {
  opacity: 0;
  animation: maps-fadeIn 0.3s ease-in-out 0.2s forwards;
}

.leaflet-tile-pane {
  filter: hue-rotate(-30deg);
}

.leaflet-marker-icon {
  filter: hue-rotate(32deg) saturate(3) contrast(1.5);
}

/* Style popup with brand colors */
.leaflet-popup-content-wrapper {
  border-radius: 12px;

  /* Glass */
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  box-shadow: 0 3px 14px rgba(82, 18, 255, 0.2);
}

.leaflet-popup-content {
  margin: 12px 16px;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

.leaflet-popup-content a {
  color: #5212ffff; /* Brand Dark Purple */
  border-bottom: 2px solid #5212ffff;
  text-decoration: none;
  font-weight: bold;
}

.leaflet-popup-tip {
  display: none;
}

/* Style zoom controls with brand colors */
.leaflet-control-zoom a {
  color: #5212ffff !important; /* Brand Dark Purple */
  transition: all 0.2s ease;

  /* Glass */
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  box-shadow: 0 3px 14px rgba(82, 18, 255, 0.2);
}

.leaflet-control-zoom a:hover {
  background-color: #5212ffff; /* Brand Dark Purple */
  color: white !important;
}

.leaflet-control-zoom {
  border: none;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid #5212ffff;
  border-radius: 12px 12px 0 0;
}

.leaflet-control-zoom a:last-child {
  border-radius: 0 0 12px 12px;
}

.leaflet-control-attribution a {
  color: #5212ffff; /* Brand Dark Purple */
  border-bottom: 1px solid #5212ffff;
}

@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane {
    filter: invert(1) hue-rotate(-130deg) saturate(1.3);
  }

  .leaflet-popup-content-wrapper {
    border-radius: 12px;
    color: white;

    /* Dark Glass */
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    border: 0.5px solid #494949;
  }

  .leaflet-popup-content a {
    color: #fde684ff; /* Brand Yellow */
    border-bottom: 2px solid #fde684ff;
  }

  .leaflet-control-zoom a {
    color: #fde684ff !important; /* Brand Yellow */

    /* Dark Glass */
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    border: 0.5px solid #494949;
  }

  .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #fde684ff;
    border-radius: 12px 12px 0 0;
  }

  .leaflet-container .leaflet-control-attribution {
    color: white;
    /* Dark Glass */
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
    border: 0.5px solid #494949;
  }

  .leaflet-container .leaflet-control-attribution a {
    color: white;
    border-bottom: 2px solid white;
  }
}
