/* Map Badges & Buttons Animation Enhancement */
/* moved ts to folder since CSS is a mess */
.map-badge {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #232936 0%, #1e2228 50%, #23242b 100%);
  color: var(--white);
  font-family: "Commissioner", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 16px;
  padding: 0.6em 1.2em;
  margin: 0.3em 0.25em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #31374a;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: mapBadgeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  text-align: left;
  line-height: 1.2;
  white-space: nowrap;
  height: auto;
  min-width: 140px;
}

.map-name {
  flex: 1;
  display: inline-block;
  margin-right: 8px;
}

/* Staggered animation delays */
.map-badge:nth-child(1) {
  animation-delay: 0.1s;
}
.map-badge:nth-child(2) {
  animation-delay: 0.15s;
}
.map-badge:nth-child(3) {
  animation-delay: 0.2s;
}
.map-badge:nth-child(4) {
  animation-delay: 0.25s;
}
.map-badge:nth-child(5) {
  animation-delay: 0.3s;
}
.map-badge:nth-child(6) {
  animation-delay: 0.35s;
}
.map-badge:nth-child(7) {
  animation-delay: 0.4s;
}
.map-badge:nth-child(8) {
  animation-delay: 0.45s;
}

/* Hover effect */
.map-badge:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: #ffb347;
}

/* Map Link Icon Styling */
.map-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(30, 34, 40, 0.7);
  color: #bfc6d8;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(49, 55, 74, 0.4);
  text-decoration: none;
  flex-shrink: 0;
}

/* Ensure Font Awesome icons are perfectly centered */
.map-link i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  font-size: 0.9rem;
  position: relative;
  top: 0;
  left: 0;
}

/* Icon hover animation */
.map-link:hover {
  background: #ffb347;
  color: #232936;
  transform: scale(1.15) rotate(5deg);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.5);
}

/* Pulsing animation for the icons */
.map-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 179, 71, 0.6) 0%,
    rgba(255, 179, 71, 0) 70%
  );
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.4s ease;
}

.map-link:hover::after {
  opacity: 1;
  transform: scale(1.5);
}

/* Ripple effect on click */
.map-link:active {
  transform: scale(0.95);
}

/* Badge entrance animation */
@keyframes mapBadgeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Subtle background shift animation for badges */
.map-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.5s ease;
  transform: translateX(-100%);
}

.map-badge:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .map-badge {
    font-size: 0.95rem;
    padding: 0.5em 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .map-link {
    width: 28px;
    height: 28px;
    margin-left: 8px;
  }

  .map-badge:hover {
    transform: translateY(-4px) scale(1.03);
  }
}

@media (max-width: 480px) {
  .map-badge {
    font-size: 0.85rem;
    padding: 0.6em 1em;
    margin: 0.2em 0.15em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .map-link {
    width: 24px;
    height: 24px;
    margin-left: 6px;
  }
}

/* Override any external alignment classes that might affect our icons */
.map-link i.align-middle {
  vertical-align: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .map-badge,
  .map-link {
    animation: none;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  .map-badge:hover,
  .map-link:hover {
    transform: none;
  }

  .map-badge::before,
  .map-link::after {
    display: none;
  }
}
