/* Explore page styles */

.explore-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.explore-header {
  margin-bottom: 1.5rem;
}

.explore-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.explore-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

.explore-back-link {
  font-size: 0.85rem;
  color: #718096;
  text-decoration: none;
  white-space: nowrap;
}

.explore-back-link:hover {
  color: #2d3748;
  text-decoration: underline;
}

.explore-subtitle {
  color: #718096;
  font-size: 0.95rem;
}

/* Mode toggle */
.explore-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
}

.mode-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: #718096;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.mode-btn:hover {
  color: #2d3748;
}

.mode-btn.active {
  color: #3182ce;
  border-bottom-color: #3182ce;
  font-weight: 600;
}

/* Search forms */
.explore-form-section.hidden {
  display: none;
}

.explore-form {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.explore-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.explore-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 180px;
}

.explore-field--narrow {
  flex: 0 1 120px;
}

.explore-field--submit {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.explore-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.explore-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #2d3748;
  background: white;
  width: 100%;
  box-sizing: border-box;
  max-width: none;
}

.explore-input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}

/* Results */
.explore-results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.explore-results-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  padding: 0;
}

.explore-results-meta {
  font-size: 0.85rem;
  font-weight: 400;
  color: #718096;
  margin-left: 0.5rem;
}

.explore-results-count {
  font-size: 0.85rem;
  color: #718096;
}

.explore-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.explore-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
  position: relative;
}

.explore-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Highlight when targeted from map popup "View in list" link */
.explore-item:target {
  background-color: #fef3c7;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px #f59e0b;
}

/* Description tooltip — desktop only (touch events don't trigger CSS :hover) */
.explore-item-tooltip {
  /* Size: auto-width up to 260px, not full row width */
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: max-content;
  max-width: 260px;
  z-index: 10;
  pointer-events: none;

  /* Appearance */
  background: #333;
  color: #f5f5f5;
  font-size: 0.8rem;
  line-height: 1.55;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);

  /* Line-clamp to 4 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  white-space: normal;

  /* Hidden by default; delay only on enter so exit is instant */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

/* Small arrow pointing down toward the item */
.explore-item-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 1rem;
  border: 5px solid transparent;
  border-top-color: #333;
}

/* Show with a short delay on hover — delay only applies on enter */
.explore-item:hover .explore-item-tooltip {
  visibility: visible;
  opacity: 1;
  transition-delay: 0.4s;
}

.explore-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.explore-item-link {
  font-weight: 600;
  color: #2b6cb0;
  text-decoration: none;
  font-size: 0.95rem;
}

.explore-item-link:hover {
  text-decoration: underline;
}

.explore-item-type {
  font-size: 0.75rem;
  background: #ebf8ff;
  color: #2c5282;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-weight: 500;
}

.explore-item-location {
  font-size: 0.85rem;
  color: #718096;
}

.explore-item-meta {
  font-size: 0.82rem;
  color: #718096;
}

.explore-item-meta + .explore-item-meta::before {
  content: "·";
  margin-right: 0.25rem;
  color: #cbd5e0;
}

/* Item badges row */
.explore-item-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Network badge */
.explore-network-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f0fff4;
  color: #276749;
  border: 1px solid #c6f6d5;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

/* Trending badge */
.explore-trending-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.explore-trending-badge--active {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.explore-trending-badge--zero {
  background: #f7fafc;
  color: #a0aec0;
  border: 1px solid #e2e8f0;
}

/* Sort controls */
.explore-sort-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #718096;
}

.explore-sort-label,
.explore-period-label {
  font-weight: 600;
  color: #4a5568;
}

.explore-sort-links,
.explore-period-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.explore-sort-link,
.explore-period-link {
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  text-decoration: none;
  color: #4a5568;
  border: 1px solid #e2e8f0;
  background: white;
  transition: background 0.15s, border-color 0.15s;
}

.explore-sort-link:hover,
.explore-period-link:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.explore-sort-link.active,
.explore-period-link.active {
  background: #ebf4ff;
  border-color: #90cdf4;
  color: #2b6cb0;
  font-weight: 600;
}

/* Landing / error / empty states */
.explore-landing,
.explore-error,
.explore-empty {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #718096;
}

.explore-error {
  border-color: #fed7d7;
  background: #fff5f5;
  color: #c53030;
}

@media (max-width: 600px) {
  .explore-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .explore-field {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .explore-field label {
    display: block;
    width: 100%;
  }

  .explore-field .explore-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .explore-field--narrow,
  .explore-field--submit {
    flex: 1 1 auto;
  }

  .explore-field--submit {
    align-items: stretch;
  }

  .explore-field--submit .btn-primary {
    width: 100%;
  }

  .explore-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Map pins (Leaflet divIcon) */
.map-pin {
  width: 24px;
  height: 24px;
  background: #3388ff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.map-pin--network {
  background: #22c55e;
}
