:root {
  --bg-light: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.95);
  --accent: #10b981; 
  --accent-glow: rgba(16, 185, 129, 0.2);
  --text-primary: #000000;
  --text-secondary: #475569;
  --border: #000000; 
  --glass-blur: 12px;
  --shadow: 4px 4px 0px rgba(0, 0, 0, 1);
  --font-outfit: "Outfit", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-outfit);
  background-color: var(--bg-light);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.leaflet-container {
  background: #eee !important;
}

.leaflet-tile {
  filter: grayscale(1) brightness(1.05);
}



.search-container {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  z-index: 1000;
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), var(--shadow);
  transform: scale(1.02);
}

.icon-search {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 0 1rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
}

#search-input::placeholder {
  color: var(--text-secondary);
}

#clear-search {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 50%;
  transition: background 0.2s;
}


#clear-search:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 8px;
  opacity: 0.2;
}

#locate-me-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  background: white;
  transition: all 0.2s ease;
  flex: none; /* Prevent shrinking */
}

#locate-me-btn:hover,
#surprise-me-btn:hover {
  background: #f0fdf4;
  color: var(--accent);
  transform: translateY(-1px);
}

#surprise-me-btn {
  color: #8b5cf6; /* Distinct purple color for surprise */
}

#surprise-me-btn:hover {
  background: #f5f3ff;
  color: #7c3aed;
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 8px;
  opacity: 0.2;
}

#locate-me-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 50%;
  transition: all 0.2s;
}

#locate-me-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
  transform: scale(1.1);
}

.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 20px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.suggestion-item.active {
  background: rgba(16, 185, 129, 0.1);
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.suggestion-details {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

.place-card {
  position: absolute;
  top: 7rem;
  left: 2rem;
  width: 320px;
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1.5px solid var(--border);
  padding: 0;
  overflow: hidden;
  z-index: 1000;
  box-shadow: var(--shadow);
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 10rem);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #000;
}

#close-card {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-content {
  padding: 0 1.25rem 1.25rem 1.25rem;
  overflow-y: auto;
}

.place-address {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Travel Info Section */
.travel-info-section {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.sun-times {
  display: flex;
  gap: 12px;
  margin-bottom: 0.75rem;
}

.sun-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef9c3;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #854d0e;
}

.sun-pill span {
  font-size: 1rem;
}

.wiki-summary p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
  max-height: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-summary .read-more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.wiki-summary .read-more:hover {
  text-decoration: underline;
}


/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  padding: 10px;
  border: 1px solid #eee;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text {
  height: 12px;
  margin-bottom: 6px;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.long { width: 90%; }

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  background: white;
  border: 1.5px solid #000;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 2px 2px 0px #000;
}

.filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px #000;
}

.filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 3px 3px 0px rgba(16, 185, 129, 0.3);
}

.attractions-section h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}


.attraction-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.attraction-item:hover {
  background: #f1f5f9;
  border-color: #000;
  box-shadow: 3px 3px 0px #000;
  transform: translate(-2px, -2px);
}

.attraction-item h4 {
  font-size: 1rem; /* Bolder size */
  font-weight: 700;
  color: #000;
  margin-bottom: 0.25rem;
}

.attraction-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.coord-badge {
    display: none;
}


/* Callout Marker Styles */
.callout-wrapper {
  position: relative;
  pointer-events: none;
}

.callout-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  position: absolute;
  top: -5px;
  left: -5px;
  pointer-events: auto;
  border: 2px solid white;
}

.callout-connector {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1.5px solid #000;
  pointer-events: none;
}

.callout-label {
  position: absolute;
  background: white;
  padding: 6px 14px;
  box-shadow: 4px 4px 0px rgba(0,0,0,1);
  border: 1.5px solid #000;
  font-weight: 600;
  font-size: 0.9rem;
  color: #000;
  white-space: nowrap;
  pointer-events: auto;
}

/* Direction: Top-Right (Default) */
.dir-tr .callout-connector {
  border-top: none;
  border-right: none;
  top: -30px;
  left: 5px;
}
.dir-tr .callout-label {
  left: 35px;
  top: -45px;
}

/* Direction: Top-Left */
.dir-tl .callout-connector {
  border-top: none;
  border-left: none;
  top: -30px;
  left: -35px;
}
.dir-tl .callout-label {
  right: 35px;
  top: -45px;
}

/* Direction: Bottom-Right */
.dir-br .callout-connector {
  border-bottom: none;
  border-right: none;
  top: 5px;
  left: 5px;
}
.dir-br .callout-label {
  left: 35px;
  top: 20px;
}

/* Direction: Bottom-Left */
.dir-bl .callout-connector {
  border-bottom: none;
  border-left: none;
  top: 5px;
  left: -35px;
}
.dir-bl .callout-label {
  right: 35px;
  top: 20px;
}


.pulse-marker {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 15px var(--accent);
}

.user-location-icon .user-dot {
  width: 16px;
  height: 16px;
  background: #3b82f6; /* Blue for user */
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 15px #3b82f6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .search-container {
    top: 1rem;
    width: 95%;
  }

  .place-card {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 60vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .card-header {
    padding: 1rem 1.25rem 0.5rem;
  }
  
  /* Make sure map attribution doesn't overlap content */
  .leaflet-control-attribution {
    margin-bottom: 60px !important;
  }
}

/* Cluster Styles */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(16, 185, 129, 0.6); /* --accent with opacity */
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(16, 185, 129, 0.9); /* --accent opaque */
  color: white;
  font-family: var(--font-outfit);
  font-weight: 700;
  border: 2px solid white;
}

/* Override default cluster styles */
.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-cluster {
  background-clip: padding-box;
  border-radius: 20px;
}

/* ---- Spot Detail Popup ---- */
.spot-detail {
  position: absolute;
  top: 7rem;
  right: 2rem;
  width: 380px;
  max-height: calc(100vh - 10rem);
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1.5px solid var(--border);
  z-index: 1001;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.spot-detail.hidden {
  display: none !important;
}

.spot-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.25rem 0.75rem;
  gap: 12px;
}

.spot-detail-title-area {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.spot-detail-title-area h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  line-height: 1.3;
}

.spot-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
}

.spot-detail-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all 0.2s;
}

.spot-detail-close:hover {
  background: #f1f5f9;
  color: #000;
}

.spot-detail-body {
  padding: 0 1.25rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Image */
.spot-detail-image-wrap {
  margin: 0 -1.25rem 1rem;
  overflow: hidden;
  max-height: 200px;
  border-bottom: 1.5px solid var(--border);
}

.spot-detail-image-wrap img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.spot-detail-image-wrap:hover img {
  transform: scale(1.05);
}

/* Description */
.spot-detail-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

/* Wiki extract */
.spot-detail-wiki {
  margin-bottom: 1rem;
}

.wiki-extract {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.wiki-extract.wiki-empty {
  color: var(--text-secondary);
  font-style: italic;
}

.spot-detail-wiki .read-more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.spot-detail-wiki .read-more:hover {
  text-decoration: underline;
}

/* Skeleton inside popup */
.spot-detail-skeleton {
  padding: 4px 0;
}

.spot-detail-skeleton .skeleton-text {
  height: 14px;
  margin-bottom: 10px;
}

/* Coordinates */
.spot-detail-coords {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 1rem;
  letter-spacing: 0.03em;
  font-family: 'Courier New', monospace;
}

/* External Links */
.spot-detail-links {
  display: flex;
  gap: 10px;
}

.spot-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1.5px solid #000;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  color: #000;
  background: white;
  box-shadow: 2px 2px 0px #000;
  transition: all 0.2s;
  font-family: var(--font-outfit);
}

.spot-link:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px #000;
}

.spot-link.wiki-link:hover {
  background: #f5f3ff;
  border-color: #8b5cf6;
  color: #8b5cf6;
  box-shadow: 4px 4px 0px #8b5cf6;
}

.spot-link.maps-link:hover {
  background: #f0fdf4;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 4px 4px 0px var(--accent);
}

/* Mobile: Spot Detail as bottom sheet */
@media (max-width: 768px) {
  .spot-detail {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
}
