:root {
  /* Primary palette extracted from image */
  --green-light: #7ed957;
  --green: #41b03f;
  --green-dark: #2f6c1f;

  --blue-light: #5fa0c8;
  --blue: #376a8d;
  --blue-dark: #1d3f56;

  --gold-light: #f3b564;
  --gold: #d99a42;
  --gold-dark: #8a6224;

  --red-light: #f77f7f;
  --red: #d44646;
  --red-dark: #7d2626;

  /* Semantic color mapping */
  --primary: var(--green);
  --primary-dark: var(--green-dark);
  --secondary: var(--blue);
  --secondary-dark: var(--blue-dark);
  --accent: var(--gold);
  --accent-dark: var(--gold-dark);
  --danger: var(--red);
  --danger-dark: var(--red-dark);

  --background: var(--green-light);
  --background-alt: var(--blue-light);
  --text: var(--green-dark);
  --text-light: var(--blue-dark);

  --border-radius: 6px;
  --transition-speed: 0.2s;
}

/* Global */
body {
  font-family: system-ui, sans-serif;
  background: var(--background);
  color: var(--text);
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #f5f5f5;
}

/* Headers */
header,nav {
  background: var(--primary);
  color: white;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Main content */
main {
  align-items: center;
  padding: 1rem;
  justify-self: center;
  margin: 0;
  width: 100%;
}

div.content {
  width: 90%;
  align-self: center;

}
/* Buttons */
button, .btn {
  background: var(--secondary);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition-speed), transform .05s ease;
}

button:hover, .btn:hover {
  background: var(--secondary-dark);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

button.secondary {
  background: var(--text-light);
}

/* Cards / Panels */
.card {
  background: var(--accent);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--danger-dark);
  width: 20rem;
  font-size: 1.2rem;
  text-decoration: none;
  transition: 0.2s ease-in-out;
}

.card:hover {
  background: var(--accent-dark);
  color: white;
  transform: translateY(-3px);
}

/* Links */
a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary-dark);
  text-decoration: underline;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-dark);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--secondary);
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a.active {
  color: var(--danger);
  font-weight: 600;
}

/* Alerts */
.alert {
  padding: 0.75rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

.alert-info {
  background: var(--blue-light);
  color: white;
}

.alert-success {
  background: var(--green-light);
  color: white;
}

.alert-warning {
  background: var(--gold-light);
  color: white;
}

.alert-danger {
  background: var(--red-light);
  color: white;
}

/* Miscellaneous */
h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.app-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.app-links div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  flex-direction: column;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left {
  width: 360px;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
}

.right {
  flex: 1;
  min-width: 300px;
  flex-basis: auto;
}

#map {
  height: 640px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  max-width: 1000px;
  margin: 0 auto;
}

#controls {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: center;
  padding: 10px;
}

#address,
#address-input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: white;
  width: 300px;
}

#add-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hint {
  font-size: 12px;
  color: #555;
  margin-top: 6px;
}

#locations-list {
  background: white;
  padding: 8px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
  max-height: 260px;
  overflow: auto;
}

.location-item {
  padding: 8px;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 8px;
  align-items: center;
}

.location-item:last-child {
  border-bottom: none;
}

.location-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: 0 0 14px;
}

.location-label {
  flex: 1;
  font-size: 14px;
}

.location-label-input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.location-actions button {
  margin-left: 6px;
  background: var(--danger);
}

.options {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.options select, .options input[type="number"] {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
}

.options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.options label input, .options label select {
  flex: 1;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

#results-box {
  margin-top: 12px;
  background: white;
  padding: 8px;
  border-radius: 8px;
  min-height: 60px;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

#results-box h4 {
  margin: 6px 0 8px;
  font-size: 16px;
}

#results-box ul {
  margin: 0;
  padding-left: 18px;
}

#results-box li {
  margin: 4px 0;
  line-height: 1.4;
}

footer {
  text-align: center;
  padding: 10px;
  color: #666;
  font-size: 13px;
}

code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

/* custom divIcon markers */
.custom-marker {
  background: transparent;
  border: none;
}

.custom-marker div {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* responsive */
@media (max-width: 900px) {
  #controls {
    flex-direction: column;
  }

  .left {
    width: 100%;
    position: static;
  }

  #map {
    height: 520px;
  }
}

#form {
  background: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#form label {
  display: block;
  margin: 0.5rem 0;
}

#form input, #form textarea, #form select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

#form button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: none;
  background: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

#form button:hover {
  background: #0056b3;
}

#results {
  max-width: 600px;
  margin: 0 auto 1rem;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#map {
  height: 500px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}


/* --- Mobile Enhancements --- */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }

  header,
  nav {
    padding: 0.75rem;
    text-align: center;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  main {
    padding: 0.5rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }

  #controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  #address,
  #address-input {
    width: 100%;
  }

  .left,
  .right {
    width: 100%;
    position: static;
    padding: 0;
  }

  .card {
    width: 100%;
    font-size: 1rem;
  }

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

  .actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  button,
  .btn {
    width: 100%;
    padding: 0.75rem;
  }

  #map {
    height: 400px;
  }

  footer {
    font-size: 12px;
    padding: 0.5rem;
  }
}

/* Ultra-small screens */
@media (max-width: 400px) {
  h1 {
    font-size: 1.4rem;
  }

  .nav-logo {
    font-size: 1.2rem;
  }

  .card {
    padding: 0.75rem;
  }
}