/**
 * Camp Booking Interactive Map CSS
 * jQuery-based interactive map with data attributes
 */

.camp-interactive-map {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.camp-interactive-map img {
  display: block;
  width: 100%;
  height: auto;
}

.camp-map-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.camp-map-marker {
  position: absolute;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.camp-map-marker:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 100;
}

.camp-map-marker-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.4),
      0 0 0 8px rgba(255, 255, 255, 0.1);
  }
}

/* Tippy.js tooltip content styling */
.camp-tooltip-content {
  padding: 4px;
}

.camp-tooltip-title {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  color: #333;
}

.camp-tooltip-description {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 8px;
}

.camp-tooltip-link {
  display: inline-block;
  color: #007bff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.camp-tooltip-link:hover {
  text-decoration: underline;
}

/* Loading state */
.camp-interactive-map.loading {
  min-height: 200px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camp-interactive-map.loading::after {
  content: "Loading map...";
  color: #999;
  font-size: 14px;
}

/* Error state */
.camp-interactive-map.error {
  min-height: 100px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  padding: 20px;
  text-align: center;
  color: #856404;
}

.camp-interactive-map.error::after {
  content: "Error loading map. Please check configuration.";
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .camp-map-marker {
    width: 35px;
    height: 35px;
  }

  .camp-map-marker-icon {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .camp-map-tooltip {
    max-width: 200px;
    font-size: 11px;
    padding: 10px 12px;
  }

  .camp-map-tooltip-title {
    font-size: 13px;
  }

  .camp-map-tooltip-description {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .camp-map-marker {
    width: 30px;
    height: 30px;
  }

  .camp-map-marker-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .camp-tooltip-title {
    font-size: 13px;
  }

  .camp-tooltip-description {
    font-size: 11px;
  }
}

.header-container:has(.camp-booking-after-top) {
  height: auto !important;

  > header {
    height: auto !important;
    background-image: none !important;

    .header-top {
      position: absolute;
      width: 100%;
    }

    .header-top-menu,
    #header_logo {
      z-index: 20;
    }

    .camp-booking-after-top {
      overflow: hidden;

      .camp-interactive-map {
        margin: 0;
        box-shadow: none;
        border-radius: 0;
        aspect-ratio: 655 / 373;
        max-height: 80vh;
        /* Calculate remaining window height using aspect ratio */
        --spacer-height: calc(80vh - (100vw * 373 / 655));

        max-width: none !important;

        .camp-map-container {
          width: 130%;

          @media (min-width: 1280px) {
            width: 100%;
          }
        }
      }
    }

    .camp-interactive-map:before {
      content: "RESSTART";
      color: white;
      text-decoration: underline;
      text-underline-offset: 10px;
      font-size: 32px;
      display: flex;
      justify-content: center;
      align-items: center;
      align-content: center;
      text-align: center;
      /* Position the spacer above the map to fill remaining viewport height */
      height: calc(var(--spacer-height) - 30vh);
      width: 100%;
      background-color: #40afdc;
    }
  }
}
