/* Base layout styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

header {
  flex: 0 0 auto; /* keeps header fixed height from content */
}

main {
  flex: 1 1 auto; /* map fills remaining space */
  position: relative;
}

/* Map styles */
#map {
  height: 100%;
  width: 100%;
}

/* Panel styles */
#control-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 300px;
  max-height: calc(100vh - 100px); 
  overflow-y: auto;
  background: white;
  padding: 10px 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 1000;
  border-radius: 6px;
  font-family: Arial, sans-serif;
}

#right-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 230px;
  background: white;
  padding: 10px 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 1000;
  border-radius: 6px;
  font-family: Arial, sans-serif;
}

/* Logo styles */
.logo-img {
  height: 54px;
  margin-left: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  vertical-align: middle;
}

/* Button styles */
.btn-primary {
  background-color: #103248;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #1a4a66;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #6b7280;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #4b5563;
  transform: translateY(-1px);
}

/* Background gradients */
.gradient-hero {
  background: linear-gradient(135deg, #103248 0%, #1a4a66 50%, #103248 100%);
}

/* Card styles */
.feature-card {
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Poll option styles */
.poll-option {
  transition: all 0.2s ease;
  cursor: pointer;
}

.poll-option:hover {
  background-color: #f8fafc;
  border-color: #103248;
}

.poll-option.selected {
  background-color: transparent;
  color: inherit;
  border-color: #103248;
}

/* Form styles */
.form-input {
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: #103248;
  box-shadow: 0 0 0 3px rgba(16, 50, 72, 0.1);
}

/* Navigation styles */
.nav-item.active {
  background-color: #103248 !important;
  color: white !important;
}

.nav-item.active:hover {
  background-color: #1a4a66 !important;
}

/* Slider styles */
.slider {
  -webkit-appearance: none;
  appearance: none;
  background: #e2e8f0;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #103248;
  cursor: pointer;
  border-radius: 50%;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #103248;
  cursor: pointer;
  border-radius: 50%;
  border: none;
}

/* Marker styles */
.marker-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: red;
  color: white;
  width: 22px;
  height: 22px;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.marker-label:active {
  cursor: grabbing;
}

/* Alert styles */
.alert {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Help page styles */

body.help-page {
  display: block;
}

.tree-item {
  transition: all 0.2s ease-in-out;
}

.tree-item:hover {
  background-color: rgb(243 244 246);
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.tree-arrow {
  transition: transform 0.2s ease-in-out;
}

.tree-arrow.expanded {
  transform: rotate(90deg);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner-custom {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}