

body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
}

h2 {
  text-align: center;
  margin: 20px 0;
}

/* Grid on home page */
/* ==== Modern Full-Width Grid ==== */
.container {
  width: 100%;
  padding: 0;
  margin: 0;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  width: 100%;
}

.tile {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  overflow: hidden;
  padding-bottom: 60px;
}

.tile img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.tile h1 {
  font-size: 1.25rem;
  font-weight: bold;
  margin: 0.75rem 1rem 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile h1 a {
  color: #000;
  text-decoration: none;
}

.tile h1 a:hover {
  text-decoration: underline;
}

.price {
  font-size: 1.25rem;
  font-weight: bold;
  color: #28a745;
  margin: 0 1rem 0.25rem;
}

.acres {
  font-size: 1.25rem;
  font-weight: bold;
  color: #000;
  margin: 0 1rem 0.5rem;
}

.location {
  font-size: 1rem;
  color: #444;
  margin: 0 1rem 0.5rem;
  line-height: 1.3;
}

/* Contact button */
.tile-contact-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  width: calc(100% - 20px);
  background: #28a745;
  color: #fff;
  border: none;
  padding: 12px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}
.tile-contact-btn:hover {
  background: #218838;
}



/* List on dashboard */
.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.dashboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ccc;
  padding: 5px 0;
  width: 100%;
  max-width: 700px;
  background: #fff;
}
.dashboard-item img {
  width: 200px;
  height: 200px;
  object-fit: cover;
}
.no-image {
  width: 100px;
  height: 100px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #666;
}

/* 3-dot menu */


/* two‐column search‐by‐map layout */
.map-search-container {
  display: block;
}



.map-pane {
  width: 100%;
  height: 500px; /* mobile fallback */
  margin-bottom: 30px;
}

.listing-pane {
  width: 100%;
  padding: 0;
  overflow: visible;
}

/* ==== Forms: Create / Edit / Login / Register ==== */
.container form {
  max-width: 600px;
  width: 100%;
  margin: 20px auto 40px;
  background: #fff;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.container form h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
}

.container form label {
  display: block;
  margin: 15px 0 5px;
  font-weight: 600;
  font-size: 16px;
}

.container form input[type="text"],
.container form input[type="email"],
.container form input[type="number"],
.container form textarea,
.container form select {
  width: 100%;
  padding: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
  min-height: 48px;
}

.container form textarea {
  min-height: 120px;
  resize: vertical;
}

.container form .features-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.container form .features-group label {
  margin: 0;
  font-size: 16px;
  font-weight: normal;
}

.container form button[type="submit"] {
  display: block;
  width: 100%;
  padding: 14px 0;
  background-color: #007bff;
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 20px;
}

.container form button[type="submit"]:hover {
  background-color: #0069d9;
}

/* Mobile tweak */
@media (max-width: 600px) {
  .container form {
    padding: 15px;
  }
  .container form input[type="text"],
  .container form input[type="email"],
  .container form input[type="number"],
  .container form textarea,
  .container form select {
    padding: 16px;
    font-size: 18px;
    min-height: 56px;
  }
  .container form label {
    font-size: 18px;
  }
  .container form button[type="submit"] {
    font-size: 18px;
    padding: 16px 0;
  }
}

/* ==== Uniform form groups ==== */
.container form .form-group {
  margin-bottom: 1.5rem;
}

.container form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 16px;
}

.container form .form-group input,
.container form .form-group textarea,
.container form .form-group select {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.container form .form-group textarea {
  min-height: 120px;
  resize: vertical;
}


/* ====== Listing Page Grid ====== */
.listing-page {
  display: grid;
  grid-template-columns: auto 300px;  /* left column fills remaining space, right column = 300px */
  gap: 2rem;
  margin: 2rem 0;
}

/* Gallery */
.gallery .featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
}
.gallery .thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
}
.gallery .thumbnails img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.gallery .thumbnails img.active {
  border-color: #007bff;
}

/* Info panel */
.info h1 {
  margin: 0 0 .5rem;
  font-size: 2rem;
}
.info .address {
  margin: 0 0 1rem;
  color: #555;
}
.stats {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-weight: 600;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-item {
  background: #f9f9f9;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.95rem;
}



/* Listing-page Contact Seller button */
.contact-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 1rem;
}
.contact-btn:hover {
  background: #0069d9;
}

/* ensure modal form never overflows its wrapper */
.modal-content form {
  width: 100%;
  box-sizing: border-box;
}

/* make every field fill the available width */
.modal-content form input,
.modal-content form textarea,
.modal-content form select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ==== Modal overlay (hides by default) ==== */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

/* ==== Box inside the modal ==== */
.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 4px;
  position: relative;
  width: 90%;
  max-width: 500px;
}

/* small-modal tweak (optional) */
.modal-content.modal-small {
  max-width: 400px;
}

/* close “×” button */
.close {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Dashboard Code */

.dashboard-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profile {
  display: flex;
  align-items: center;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0.75rem;
}
.profile-info h2 {
  margin: 0;
  font-size: 1.25rem;
}
.btn {
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid #666;
  background: #fff;
  color: #333;
  font-size: 0.9rem;
}
.btn-primary {
  background: #4a90e2;
  color: #fff;
  border-color: #4a90e2;
}
.new-listing {
  font-weight: bold;
}

.dashboard-intro {
  font-size: 0.95rem;
  margin: 0.5rem 0 1.5rem;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dashboard-item {
  display: flex;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}
.listing-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
}
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ddd;
  color: #666;
  font-size: 0.8rem;
}
.listing-details {
  flex-grow: 1;
  padding: 0.75rem;
  position: relative;
}
.listing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.listing-header a {
  text-decoration: none;
  color: #333;
  font-size: 1rem;
}
.listing-price {
  font-weight: bold;
  color: #27ae60;
  margin-left: 0.5rem;
}
.listing-menu {
  position: relative;
  cursor: pointer;
  padding: 0 0.5rem;
}

.menu {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  z-index: 20;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.menu:hover {
  background: rgba(0, 0, 0, 0.65);
}

.menu-popup {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 30;
}

.menu-popup a {
  display: block;
  text-decoration: none;
  color: #000;
  padding: 4px 0;
}

.menu-popup a:hover {
  color: #28a745;
}

.listing-description {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.listing-meta {
  font-size: 0.8rem;
  color: #777;
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.avatar-large {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-info h1 {
  margin: 0;
  font-size: 1.75rem;
}

.profile-info .role {
  margin: 0.25rem 0 1rem;
  color: #555;
}

.profile-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

form input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: .75rem;
  margin-bottom: 1rem;
}
form button {
  display: block;
  width: 100%;
  padding: .75rem;
  margin-top: .5rem;
}


.contact-seller-btn {
  background: #28a745;       /* consistent green */
  color: #fff;
  border: none;
  padding: .5em 1em;
  border-radius: .25em;
  cursor: pointer;
  font-size: 1rem;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: #fff;
  padding: 1rem;
  border-radius: .5rem;
  max-width: 400px;
  width: 90%;
  position: relative;
}
.modal-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.hidden { display: none; }

/* ─── Listing Page: smaller seller avatar ─── */
.seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Show the inner modal box when the overlay is active */
.modal-overlay .modal {
  display: block !important;
}

/* ─── Contact-Seller Modal Overrides ─── */

/* 1) Center and constrain the modal box */
#contactSellerModal .modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 90% !important;
  max-width: 400px !important;
  max-height: 225px !important;
  padding: 1rem !important;
  overflow-y: auto !important;
  background: #fff !important;
  border-radius: 0.5rem !important;
  z-index: 10001 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* 2) Make sure the overlay sits above everything */
#contactSellerModal,
.modal-overlay {
  z-index: 10000 !important;
}

/* 3) Style the textarea to fill the form nicely */
#contactSellerForm textarea {
  width: 100% !important;
  min-height: 120px !important;
  box-sizing: border-box !important;
  padding: 0.5rem !important;
  border: 1px solid #ccc !important;
  border-radius: 0.25rem !important;
  resize: vertical !important;
  margin-bottom: 1rem !important;
}

/* 4) Style the Send button like your other green buttons */
#contactSellerForm button[type="submit"] {
  background: #28a745 !important;
  color: #fff !important;
  border: none !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.25rem !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
#contactSellerForm button[type="submit"]:hover {
  background: #218838 !important;
}

/* 5) Keep the close “×” clickable on top */
#contactSellerModal .modal-close {
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  font-size: 1.5rem !important;
  z-index: 10002 !important;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}
.topbar-inner {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.topbar a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  font-size: 1rem;
}
.topbar a:hover {
  color: #28a745;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}




@media (max-width: 600px) {
  .topbar-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  h2 {
    font-size: 1.25rem;
    margin: 1rem 0 0.5rem;
  }
}
