/* =========================================================
   Eco Map Plugin — Frontend Styles
   ========================================================= */

/* ── Container & Controls ─────────────────────────────── */
.eco-map-container {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.eco-map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.eco-map-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 2px solid #2d6a4f;
  border-radius: 50px;
  background: #fff;
  color: #2d6a4f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}

.eco-map-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(45,106,79,0.2);
}

.eco-map-toggle-btn.active {
  background: #2d6a4f;
  color: #fff;
}

.eco-map-locate-btn {
  border-color: #457b9d;
  color: #457b9d;
}

.eco-map-locate-btn.active,
.eco-map-locate-btn:hover {
  background: #457b9d;
  color: #fff;
  border-color: #457b9d;
}

/* Tile switcher group in the controls bar */
.eco-tile-switcher {
  display: inline-flex;
  gap: 0;
  border: 2px solid #6c8ebf;
  border-radius: 50px;
  overflow: hidden;
  margin-left: auto;
}

.eco-tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: none;
  background: #fff;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid #d0d8e8;
}
.eco-tile-btn:last-child { border-right: none; }
.eco-tile-btn:hover  { background: #eef2fa; }
.eco-tile-btn.active { background: #6c8ebf; }

/* ── Map Canvas ───────────────────────────────────────── */
.eco-map-embed {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.08);
}

/* ── Custom Marker ────────────────────────────────────── */
.eco-custom-marker {
  background: none !important;
  border: none !important;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: filter 0.2s;
}
.eco-custom-marker:hover {
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* ── Leaflet Popup Reset ──────────────────────────────── */
.eco-leaflet-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  border: none;
}
.eco-leaflet-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}
.eco-leaflet-popup .leaflet-popup-tip-container {
  margin-top: -1px;
}
.eco-leaflet-popup .leaflet-popup-tip {
  background: #fff;
}
.eco-leaflet-popup .leaflet-popup-close-button {
  color: #666;
  font-size: 18px;
  width: 28px;
  height: 28px;
  line-height: 28px;
  top: 6px;
  right: 6px;
  z-index: 10;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  text-align: center;
  padding: 0;
}

/* ── Popup — Modern Card ──────────────────────────────── */
.eco-popup {
  min-width: 280px;
  max-width: 340px;
  background: #fff;
}

.eco-popup-img {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
}
.eco-popup-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.eco-popup-img:hover img { transform: scale(1.04); }

.eco-popup-body {
  padding: 14px 16px 16px;
}

.eco-popup-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
}

.eco-popup-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.eco-tag {
  background: #d8f3dc;
  color: #2d6a4f;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.eco-popup-addr {
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.eco-popup-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: #555;
  line-height: 1.55;
}

.eco-popup-link {
  display: inline-block;
  padding: 6px 14px;
  background: #2d6a4f;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.eco-popup-link:hover { background: #1b4332 !important; }

/* ── Route Popup Specifics ────────────────────────────── */
.eco-popup-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.eco-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eco-stat {
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 12px;
}

/* ── Popup — Nature Theme override ───────────────────── */
.eco-popup-nature {
  background: #f0f7f4;
}
.eco-popup-nature .eco-popup-title { color: #1b4332; }
.eco-popup-nature .leaflet-popup-tip { background: #f0f7f4; }

/* ── Popup — Minimal override ─────────────────────────── */
.eco-popup-minimal .eco-popup-img { display: none; }
.eco-popup-minimal .eco-popup-body { padding: 12px; }
.eco-popup-minimal .eco-popup-title { font-size: 14px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .eco-map-toggle-btn { font-size: 12px; padding: 6px 11px; }
  .eco-map-locate-btn { margin-left: 0; }
  .eco-popup { min-width: 200px; max-width: 260px; }
}

/* ═══════════════════════════════════════════════════════
   Photo Gallery Slider — inside map popups
   ═══════════════════════════════════════════════════════ */

.eco-popup-gallery {
  position: relative;
  width: 100%;
  height: 170px;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

/* Track holds all slides side-by-side */
.eco-gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.eco-gallery-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.eco-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.eco-gallery-slide:hover img { transform: scale(1.03); }

/* Prev / Next arrows */
.eco-gallery-prev,
.eco-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s, transform 0.15s;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eco-gallery-prev { left: 8px; }
.eco-gallery-next { right: 8px; }
.eco-gallery-prev:hover,
.eco-gallery-next:hover { background: rgba(0,0,0,0.8); transform: translateY(-50%) scale(1.1); }

/* Hide arrows if only one photo */
.eco-popup-gallery.single-photo .eco-gallery-prev,
.eco-popup-gallery.single-photo .eco-gallery-next { display: none; }

/* Dot indicators */
.eco-gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 10;
}
.eco-gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none; padding: 0; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.eco-gallery-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* Photo counter badge */
.eco-gallery-counter {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  z-index: 10;
  pointer-events: none;
}

/* Single image (no gallery) keeps original styling */
.eco-popup-img {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
}
.eco-popup-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.eco-popup-img:hover img { transform: scale(1.04); }

/* ── Location popup: status note ─────────────────────────── */
.eco-popup-status {
  font-size: 12px;
  color: #5d4037;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 6px 0 8px;
  line-height: 1.4;
}

/* ── Gallery tab switcher (Before / After) ───────────────── */
.eco-popup-gallery-tabs { width: 100%; }

.eco-gallery-tab-strip {
  display: flex;
  width: 100%;
  border-bottom: 1px solid #e0e0e0;
  background: #f5f5f5;
}
.eco-gallery-tab-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 0;
  background: #eeeeee;
  color: #5e6b5f;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}
.eco-gallery-tab-btn:hover {
  background: #e0f0e3;
  color: #275c28;
}
.eco-gallery-tab-btn.active {
  background: #1a3d1b;
  color: #ffffff;
  border-bottom-color: #1a3d1b;
}

.eco-gallery-panel { display: none; }
.eco-gallery-panel.active { display: block; }
