/* SFAS Archaeological Map Styles */

.sfas-map-container {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 500px;
  border: 1px solid #c4b59a;
  border-radius: 6px;
  overflow: hidden;
}

.sfas-map-container.no-sidebar {
  display: block;
}

#sfas-map {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.sfas-map-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0;
}

.sfas-map-controls label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1a3c2a;
  margin-right: 4px;
}

/* Toggle buttons (SFAS, Finds) */
.sfas-toggle-btn {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border: 2px solid #b8860b;
  background: #fff;
  color: #b8860b;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.sfas-toggle-btn:hover {
  background: #fdf6e3;
}

.sfas-toggle-btn[data-active="true"] {
  background: #b8860b;
  color: #fff;
  border-color: #b8860b;
}

.sfas-toggle-btn.finds-toggle {
  border-color: #4a7c6a;
  color: #4a7c6a;
}

.sfas-toggle-btn.finds-toggle:hover {
  background: #e8f0ec;
}

.sfas-toggle-btn.finds-toggle[data-active="true"] {
  background: #4a7c6a;
  color: #fff;
  border-color: #4a7c6a;
}

/* Layer toggle buttons */
.sfas-layer-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border: 1.5px solid #8a8a8a;
  background: #fff;
  color: #666;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.sfas-layer-btn:hover {
  background: #f0f0f0;
}

.sfas-layer-btn[data-active="true"] {
  background: #1a3c2a;
  color: #fff;
  border-color: #1a3c2a;
}

.sfas-filter-divider {
  color: #c4b59a;
  margin: 0 6px;
  font-size: 1.1rem;
  user-select: none;
}

/* Search input */
.sfas-search-input {
  font-size: 0.82rem;
  padding: 4px 10px;
  border: 1px solid #c4b59a;
  background: #fff;
  color: #3a3a3a;
  border-radius: 3px;
  min-width: 160px;
  max-width: 200px;
}

.sfas-search-input:focus {
  outline: 2px solid #1a3c2a;
  outline-offset: 1px;
}

.sfas-search-input::placeholder {
  color: #aaa;
}

/* Dropdowns */
.sfas-region-select {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 10px;
  border: 1px solid #c4b59a;
  background: #fff;
  color: #3a3a3a;
  border-radius: 3px;
  cursor: pointer;
  min-width: 140px;
}

.sfas-region-select:focus {
  outline: 2px solid #1a3c2a;
  outline-offset: 1px;
}

/* Period filter buttons */
.sfas-filter-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid #c4b59a;
  background: #fff;
  color: #3a3a3a;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.sfas-filter-btn:hover {
  background: #f5f0e8;
}

.sfas-filter-btn.active {
  background: #1a3c2a;
  color: #fff;
  border-color: #1a3c2a;
}

/* Timeline slider */
.sfas-timeline-slider {
  width: 160px;
  accent-color: #1a3c2a;
  cursor: pointer;
}

.sfas-timeline-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #666;
  min-width: 180px;
  text-align: center;
}

/* Cluster icon */
.sfas-cluster-icon {
  background: #1a3c2a;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Sidebar */
.sfas-map-sidebar {
  width: 320px;
  background: #fff;
  overflow-y: auto;
  border-left: 1px solid #e8dfd0;
  flex-shrink: 0;
}

.sfas-map-sidebar-header {
  padding: 12px 16px;
  background: #f5f0e8;
  border-bottom: 1px solid #e8dfd0;
}

.sfas-map-sidebar-header h3 {
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1a3c2a;
  margin: 0;
}

.sfas-map-sidebar-header p {
  font-size: 0.72rem;
  color: #666;
  margin: 2px 0 0;
}

/* Report sighting button */
.sfas-sighting-btn {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 12px;
  background: #c47a0a;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.sfas-sighting-btn:hover {
  background: #a86608;
}

/* Site cards */
.sfas-site-card {
  padding: 9px 14px;
  border-bottom: 1px solid #f0ebe0;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.sfas-site-card:hover {
  background: #f5f0e8;
}

.sfas-site-card.active {
  background: #e8f0e8;
  border-left-color: #1a3c2a;
}

.sfas-site-card h4 {
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a3c2a;
  margin: 1px 0;
}

.sfas-site-card .period-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 2px;
  margin-bottom: 2px;
}

.sfas-site-card .notes {
  font-size: 0.76rem;
  line-height: 1.45;
  color: #666;
}

/* Sighting form overlay */
.sfas-sighting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sfas-sighting-form-container {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  max-width: 480px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.sfas-sighting-form-container h3 {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  color: #1a3c2a;
  margin: 0 0 8px;
}

.sfas-sighting-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.sfas-sighting-close:hover {
  color: #333;
}

.sfas-form-row {
  margin-bottom: 12px;
}

.sfas-form-row label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
}

.sfas-form-row input[type="text"],
.sfas-form-row input[type="email"],
.sfas-form-row input[type="number"],
.sfas-form-row select,
.sfas-form-row textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.sfas-form-row textarea {
  resize: vertical;
}

.sfas-form-row input:focus,
.sfas-form-row select:focus,
.sfas-form-row textarea:focus {
  outline: 2px solid #1a3c2a;
  outline-offset: 1px;
}

.sfas-form-row-pair {
  display: flex;
  gap: 12px;
}

.sfas-form-row-pair > div {
  flex: 1;
}

.sfas-submit-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #1a3c2a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.sfas-submit-btn:hover {
  background: #2a5c3f;
}

.sfas-sighting-result {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
}

.sfas-sighting-result.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.sfas-sighting-result.error {
  background: #fbe9e7;
  color: #c62828;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  border-radius: 5px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 240px;
  max-width: 300px;
}

.sfas-popup h3 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a3c2a;
  margin: 0 0 4px;
  line-height: 1.3;
}

.sfas-popup .period {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b8860b;
  margin-bottom: 2px;
}

.sfas-popup .notes {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #444;
}

.sfas-popup .coords {
  font-size: 0.68rem;
  color: #999;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.sfas-popup .links {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.sfas-popup .links a {
  font-size: 0.78rem;
  color: #1a3c2a;
  text-decoration: none;
  font-weight: 600;
}

.sfas-popup .links a:hover {
  text-decoration: underline;
}

/* Volunteer CTA banner */
.sfas-map-cta {
  margin-top: 12px;
  padding: 12px 18px;
  background: #f5f0e8;
  border: 1px solid #e8dfd0;
  border-radius: 5px;
  text-align: center;
}

.sfas-map-cta p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #555;
  margin: 0;
}

.sfas-map-cta a {
  color: #b8860b;
  font-weight: 700;
  text-decoration: none;
}

.sfas-map-cta a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 800px) {
  .sfas-map-container {
    flex-direction: column-reverse;
    height: auto;
  }
  .sfas-map-sidebar {
    width: 100%;
    height: 35vh;
    border-left: none;
    border-top: 1px solid #e8dfd0;
  }
  #sfas-map {
    height: 55vh;
  }
  .sfas-timeline-slider {
    width: 70px;
  }
  .sfas-search-input {
    min-width: 120px;
  }
}

/* Pulse animation for "Report a Sighting" attention draw */
@keyframes sfas-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); box-shadow: 0 0 8px rgba(196, 122, 10, 0.5); }
}
