:root {
  --radius-soft: 5px;
  --radius-medium: 10px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, sans-serif;
}

#container {
  display: flex;
  height: 100%;
  flex-direction: row;
}

#map-container {
  flex: 2 1 0;
  min-width: 0;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

#sidebar {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f6f7fb;
  border-left: 1px solid #e2e2e2;
}

.sidebar-footer {
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid #ececec;
  color: #6b7280;
  font-size: 0.9rem;
  text-align: right;
}

.content {
  background: #fff;
  border-radius: var(--radius-medium);
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border: 1px solid #ececec;
  flex: 1;
}

.content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #1f2937;
}

.content p {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.content hr {
  margin: 1.25rem 0;
  border-top: 1px solid #ececec;
}

#info em {
  color: #6b7280;
}

#info h3 {
  font-size: 1.2rem;
  margin-top: 0;
}

#info p {
  margin-bottom: 0.8rem;
}

#info a {
  color: #0d6efd;
  text-decoration: none;
}

#info a:hover {
  text-decoration: underline;
}

.species-list {
  margin-bottom: 1rem;
}

.species-list strong {
  color: #111827;
}

.species-list a {
  color: #0d6efd;
}

.species-list a:hover {
  text-decoration: underline;
}

#map-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: 100%;
  max-width: 620px;
}

.search-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.map-search {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px;
  border-radius: var(--radius-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  gap: 8px;
  flex: 1;
}

.search-row input {
  flex: 1;
}

.search-btn {
  flex: 0 0 auto;
}

.control-buttons {
  display: flex;
  gap: 10px;
}

.control-buttons .btn,
.search-btn {
  border-radius: var(--radius-soft);
}

.control-buttons .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  background-color: #6c757d;
  border-color: #6c757d;
}

.control-buttons .btn:not(:disabled) {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.control-buttons .btn:not(:disabled):hover {
  background-color: #0b5ed7;  /* slightly darker blue */
  border-color: #0a58ca;
}

.suggestions {
  position: relative;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}

.suggestion-item {
  padding: 8px 10px;
  border-radius: var(--radius-soft);
  cursor: pointer;
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 6px;
}

.suggestion-item:hover {
  background: #f0f0f0;
}

@media (max-width: 768px) {
  #container {
    flex-direction: column;
  }

  #map-container {
    height: 50%;
  }

  #sidebar {
    height: 50%;
    border-left: none;
    border-top: 1px solid #ccc;
  }

  #map-controls {
    width: calc(100% - 24px);
  }

  .search-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .control-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .control-buttons .btn {
    width: 48%;
  }
}

.fallback-warning {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 0.75rem 0;
}
