:root {
  --bg: #ffffff;
  --surface: #f7f9f7;
  --border: #e2e8e4;
  --accent: #1a6e3c;
  --accent2: #b5303f;
  --text: #1c231e;
  --muted: #6b7a70;
  --radius: 12px;
}

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

html, body {
  overflow-x: hidden; /* safety net against any element pushing width past 100vw */
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--accent2); /* fallback red while image loads / if it fails */
  background-image: url("../images/christmas-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, .navbar-brand {
  font-weight: 700;
}

/* Top nav — mobile-first: brand on its own line, buttons wrap below and
   fill the width; becomes a single row from tablet width up. */
.navbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}
.navbar .container-fluid {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0;
}
.navbar-brand {
  color: var(--accent) !important;
  font-size: clamp(1rem, 4.5vw, 1.3rem);
  white-space: normal;
  line-height: 1.2;
}
.navbar .container-fluid > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}
.nav-link {
  color: var(--accent) !important;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem !important;
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
}
.nav-link.active {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
}

@media (min-width: 768px) {
  .navbar .container-fluid {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .navbar .container-fluid > div {
    width: auto;
    flex-wrap: nowrap;
  }
  .nav-link {
    flex: 0 0 auto;
    margin-left: 0.5rem;
  }
}

/* Content container (forms / admin — map page overrides to full width) */
.page-container {
  max-width: 640px;
  margin: 1.5rem auto;
  padding: 2rem 1.5rem 2.5rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}

/* Buttons */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #145a30;
  border-color: #145a30;
}
.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
  border-radius: var(--radius);
}
.btn-outline-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
}
.btn-danger {
  background-color: var(--accent2);
  border-color: var(--accent2);
  border-radius: var(--radius);
  font-weight: 600;
}

/* Badges */
.badge-holly {
  background-color: var(--accent2);
  color: #fff;
}

/* Form controls */
.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(26, 110, 60, 0.15);
}
label {
  font-weight: 600;
  color: var(--text);
}
.text-muted-custom {
  color: var(--muted);
}

/* Fixed reference landmark pin on the submission map */
.reference-marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent2);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--accent2);
}
.leaflet-tooltip.reference-marker-label {
  background: var(--accent2);
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
}
.leaflet-tooltip.reference-marker-label::before {
  border-right-color: var(--accent2);
}

/* Map */
#map, #pick-map {
  width: 100%;
  border: 1px solid var(--border);
}
#map {
  flex: 1 1 auto; /* fills whatever space is left below the navbar, however tall it is */
  min-height: 320px;
  border-radius: var(--radius);
  margin: 0.75rem;
  width: auto;
}
#pick-map {
  height: 320px;
  border-radius: var(--radius);
}

@media (min-width: 768px) {
  #map {
    margin: 1rem;
  }
}

/* Hover tooltip preview on map pins */
.leaflet-tooltip.leaflet-tooltip-top {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  padding: 0;
}
.leaflet-tooltip.leaflet-tooltip-top::before {
  border-top-color: var(--border);
}
.pin-tooltip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  max-width: 220px;
}
.pin-tooltip .tooltip-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.pin-tooltip span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Leaflet popup content */
.leaflet-popup-content h5 {
  margin-bottom: 0.25rem;
  color: var(--accent);
}
.popup-photo {
  width: 100%;
  border-radius: 8px;
  margin-top: 0.5rem;
}
.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
}

/* Christmas tree map pins */
.tree-marker {
  background: none;
  border: none;
}
.tree-pin {
  font-size: 30px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  transition: transform 0.15s ease;
}
.tree-pin:hover {
  transform: scale(1.15);
}

/* Gentle falling snow overlay */
#snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}
#snow .flake {
  position: absolute;
  top: -10px;
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
  user-select: none;
  animation-name: snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes snow-fall {
  0% {
    transform: translateY(-10px) translateX(0);
    opacity: 0.9;
  }
  100% {
    transform: translateY(105vh) translateX(20px);
    opacity: 0.7;
  }
}

/* Admin mini-map preview */
.mini-map {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 0.75rem 0 0.25rem;
}

/* Admin list rows */
.submission-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.submission-row .email {
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem;
}
