*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f3;
  color: #1a2e1a;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2rem;
  color: #1b5e20;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #5a7a5a;
  font-size: 1rem;
  margin-top: 0.25rem;
}

form {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
  .form-row .form-group:last-child {
    grid-column: 1 / -1;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #3a5a3a;
  margin-bottom: 0.35rem;
}

input[type="date"],
input[type="text"],
input[type="tel"],
input[type="url"],
select {
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #c8d8c8;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #1a2e1a;
  background: #fafcfa;
  transition: border-color 0.15s;
}

input[type="date"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus {
  outline: none;
  border-color: #43a047;
  box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.15);
}

.park-search-wrapper {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #c8d8c8;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f4f0;
}

.dropdown-item:hover {
  background: #e8f5e9;
}

.dropdown-item .region {
  color: #7a9a7a;
  font-size: 0.8rem;
}

.selected-parks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.park-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.park-tag button {
  background: none;
  border: none;
  color: #66bb6a;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

.park-tag button:hover {
  color: #c62828;
}

button[type="submit"] {
  width: 100%;
  padding: 0.75rem;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.15s;
}

button[type="submit"]:hover {
  background: #1b5e20;
}

button[type="submit"]:disabled {
  background: #a5d6a7;
  cursor: not-allowed;
}

.error {
  background: #ffebee;
  color: #c62828;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

#results {
  margin-top: 2rem;
}

#results h2 {
  color: #1b5e20;
  margin-bottom: 0.5rem;
}

#results-summary {
  color: #5a7a5a;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.park-result {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  overflow: hidden;
}

.park-result-header {
  padding: 0.75rem 1rem;
  background: #e8f5e9;
  font-weight: 600;
  color: #2e7d32;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.park-result-header .count {
  background: #2e7d32;
  color: #fff;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.park-result-header .count.zero {
  background: #9e9e9e;
}

.site-list {
  padding: 0;
  list-style: none;
}

.park-result-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  gap: 1rem;
}

.avail-summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.avail-number {
  font-size: 2rem;
  font-weight: 700;
  color: #2e7d32;
  line-height: 1;
}

.avail-label {
  font-size: 0.9rem;
  color: #5a7a5a;
}

.book-link-big {
  display: inline-block;
  color: #fff;
  background: #2e7d32;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.book-link-big:hover {
  background: #1b5e20;
}

.no-results {
  padding: 1rem;
  color: #7a7a7a;
  text-align: center;
  font-style: italic;
}

.hidden {
  display: none !important;
}

/* ── shared button classes (used by modals) ── */
.btn-primary {
  padding: 0.65rem 1.4rem;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1b5e20; }
.btn-primary:disabled { background: #a5d6a7; cursor: not-allowed; }

.btn-secondary {
  padding: 0.65rem 1.2rem;
  background: transparent;
  color: #6b7280;
  border: 1.5px solid #c8d8c8;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: #9ca3af; color: #374151; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ── schedule modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.modal h2 {
  color: #1b5e20;
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.modal-subtitle {
  color: #5a7a5a;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* reset the global form styles inside the modal */
.modal form {
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.modal button[type="submit"] {
  width: auto;
  margin-top: 0;
}

/* ── "Schedule this scan" button in results ── */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.btn-schedule {
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: #2e7d32;
  border: 1.5px solid #2e7d32;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-schedule:hover { background: #e8f5e9; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
