/* Main Styles for 88Days Map */

/* Base Styles */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Map Container */
#map {
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Search Container */
#search-container {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: white;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#search-input {
  padding: 5px;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

#search-results {
  max-height: 200px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  display: none;
}

.search-result {
  padding: 8px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-result:hover {
  background: #f0f0f0;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-right: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 18px;
}

/* Button Styles */
.btn-primary {
  background: #4a90e2;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary:hover {
  background: #357abd;
}

/* Visitor Stats */
#visitor-stats {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  padding: 8px;
  border-radius: 5px;
  font-size: 12px;
  font-family: Arial, sans-serif;
}

.stat-line {
  margin: 2px 0;
}

/* Legend */
#legend {
  position: absolute;
  top: 60px;
  left: 10px;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  max-width: 350px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  transition: all 0.3s ease;
}

.legend-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.legend-toggle-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.3s ease;
}

.legend-collapsed .legend-toggle-icon {
  transform: rotate(-90deg);
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.legend-item:hover {
  background: #f8f9fa;
  transform: translateX(3px);
}

.legend-color {
  width: 20px;
  height: 15px;
  margin-right: 10px;
  border: 1px solid #333;
  border-radius: 3px;
}

.legend-text {
  flex: 1;
  line-height: 1.3;
}

.legend-category {
  font-weight: bold;
  color: #444;
  font-size: 12px;
}

.legend-subcategory {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.legend-items {
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  overflow: hidden;
}

.legend-source {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  font-size: 11px;
  color: #666;
}

.legend-source a {
  color: #0066cc;
  text-decoration: none;
}

.legend-source a:hover {
  text-decoration: underline;
}

/* Info Panel */
#info-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1001;
  background: rgba(255,255,255,0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  max-width: 400px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  display: none;
}

.info-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.info-content {
  line-height: 1.5;
}

.close-btn {
  float: right;
  cursor: pointer;
  font-size: 18px;
  color: #666;
}

.close-btn:hover {
  color: #000;
}