/* ====================
   1. RESET & BASE
   ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  color: #333;
  background: #f9f9f9;
  line-height: 1.4;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
  padding-left: 0;
}

/* Hide Leaflet attribution */
.leaflet-control-attribution {
  display: none !important;
}

/* ====================
   2. HERO / INDEX
   ==================== */
.hero {
  text-align: center;
  padding: 2rem 1rem;
  background: #fffbe6;
}
.hero .logo {
  width: 150px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #d2691e;
}
.hero p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.hero .btn {
  display: inline-block;
  background: #d2691e;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.2s;
}
.hero .btn:hover {
  background: #b7550c;
}
.hero-img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  margin-top: 1rem;
}

/* ====================
   3. FEATURES & USE-CASES
   ==================== */
.features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2rem 1rem;
  background: #fff;
}
.feature {
  flex: 1 1 250px;
  margin: 1rem;
  padding: 1rem;
  border: 2px dashed #d2691e;
  border-radius: 4px;
}
.feature h2 {
  color: #d2691e;
  margin-bottom: 0.5rem;
}
.feature p {
  font-size: 0.95rem;
}
.use-cases {
  padding: 2rem 1rem;
  background: #f0f0f0;
}
.use-cases h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: #d2691e;
}
.use-cases ul {
  max-width: 600px;
  margin: 0 auto;
}
.use-cases li {
  margin-bottom: 0.75rem;
}

/* ====================
   4. FOOTER
   ==================== */
footer {
  text-align: center;
  padding: 1rem;
  background: #fff;
  font-size: 0.85rem;
}

/* ====================
   5. NAVBAR & HAMBURGER
   ==================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #d2691e;
  padding: 0.5rem 1rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 2000;
}
.nav-brand {
  color: #fff;
  font-weight: bold;
}
.nav-menu {
  display: flex;
  gap: 1rem;
}
.nav-menu a {
  color: #fff;
  text-decoration: none;
}
.nav-menu .right {
  margin-left: auto;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #fff;
  display: block;
}
@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
  }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #d2691e;
    flex-direction: column;
    display: none;
    padding: 0.5rem 1rem;
  }
  .nav-menu.open {
    display: flex;
  }
  .nav-menu a {
    padding: 0.5rem 0;
  }
}

/* ====================
   6. LOGIN FORM (INDEX)
   ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 1rem;
}
.login-form {
  background: #fff;
  padding: 2rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-form h2 {
  margin-bottom: 1rem;
  color: #d2691e;
}
.login-form input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.login-form button {
  background: #d2691e;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.login-form button:hover {
  background: #b7550c;
}

/* ====================
   7. POST-FORM (post.php)
   ==================== */
.post-form {
  max-width: 600px;
  margin: 6rem auto 2rem; /* account for fixed navbar */
  padding: 1rem;
  background: #fff;
  border-radius: 4px;
}
.post-form h2 {
  color: #d2691e;
  margin-bottom: 1rem;
}
.post-form label {
  display: block;
  margin-bottom: 0.75rem;
}
.post-form input,
.post-form select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.post-form button {
  background: #d2691e;
  color: #fff;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.post-form button:hover {
  background: #b7550c;
}
.error {
  color: red;
  margin-bottom: 1rem;
}

/* ====================
   8. MAP CONTROLS & NEAREST LIST
   ==================== */
#map {
  margin-top: 3.5rem; /* clear fixed navbar */
  height: 60vh;
}
.controls {
  position: absolute;
  top: calc(3.5rem + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 320px;
  font-size: 0.9rem;
}
.controls label {
  margin: 0;
  white-space: nowrap;
}
.controls hr {
  flex-basis: 100%;
  margin: 0.25rem 0;
  width: 100%;
  border: none;
  border-top: 1px solid #ddd;
}
.controls button {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}
.controls input[type="number"] {
  width: 3rem;
  padding: 0.25rem;
}
.nearest-list {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 300px;
  background: #fff;
  padding: 1rem;
  max-height: 30vh;
  overflow: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  border-radius: 4px;
}
.nearest-list h3 {
  margin-top: 0;
}
.nearest-list ul {
  list-style: none;
  padding-left: 0;
}
.nearest-list li {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.nearest-list li:hover {
  background: #f5f5f5;
}

/* ====================
   9. MOBILE FULL-WIDTH CONTROLS (UPDATED)
   ==================== */
@media (max-width: 600px) {
  .controls {
    top: 3.5rem;
    left: 0;
    transform: none;
    width: 100%;
    padding: 0.25rem 0.5rem;
    display: flex;
    flex-wrap: nowrap;            /* force one row */
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;                 /* tighter gap */
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  }
  .controls label,
  .controls button,
  .controls input {
    flex: 0 0 auto;               /* no grow/shrink */
    font-size: 0.8rem;            /* smaller text */
    white-space: nowrap;
    margin: 0;
    padding: 0 0.25rem;
  }
  .controls button {
    padding: 0.25rem 0.5rem;
  }
  .controls input[type="number"] {
    width: 2.5rem;
    padding: 0.2rem;
  }
  .controls hr {
    display: none;
  }
}

/* ====================
   10. RESPONSIVE TWEAKS
   ==================== */
@media (max-width: 600px) {
  .features, .use-cases {
    padding: 1rem;
  }
  .post-form {
    margin-top: 8rem;
  }
}
/* tighten up space between hero and login */
.hero {
  padding-bottom: 0.2rem !important;
}
.login-container {
  margin-top: -5rem;  /* pull it up */
}
/* ==== FORCE LOGIN BOX UP UNDER HERO ==== */
.hero {
  /* shrink bottom padding */
  padding-bottom: 0.2rem !important;
  /* remove any bottom margin */
  margin-bottom: 0 !important;
}
.login-container {
  /* cancel the 80vh/60vh height */
  min-height: auto !important;
  /* pull it up into the hero space */
  margin-top: -0.5rem !important;
  /* remove extra top padding */
  padding-top: 0 !important;
}
.nav-logo {
  height: 40px;    /* adjust as needed */
  width: auto;
  display: block;
}
#install-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #d2691e;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  z-index: 10000;
}
#ios-install-banner {
  display: none;
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  background: #fffbe6;
  color: #333;
  border-top: 1px solid #ddd;
  padding: 1rem;
  text-align: center;
  z-index: 10000;
}
#ios-install-banner img {
  width: 24px;
  vertical-align: middle;
  margin: 0 0.25rem;
}
#ios-install-banner button {
  background: #d2691e;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-left: 1rem;
  cursor: pointer;
}
/* in assets/css/style.css */
html, body {
  /* Allow vertical scrolling when content overflows,
     but disable all pinch-zoom and horizontal panning */
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;    /* only vertical pan */
}
