/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: #f6f8fa;
  color: #23272f;
  min-height: 100vh;
}
a {
  color: #2b7cff;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #184e96;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: 1em;
  outline: none;
  border: none;
  background: none;
}
input, select, textarea {
  background: #f8fbff;
  border: 1px solid #e3e9f3;
  border-radius: 0.6rem;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  transition: border 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: #2b7cff;
  background: #fff;
}
textarea {
  min-height: 60px;
  resize: vertical;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.2rem;
}
.container.listings-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* Header & Nav */
header {
  background: #fff;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.03);
  position: sticky;
  top: 0;
  z-index: 100;
}
.container.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 0.5em;
  justify-content: space-between;
}
.logo {
  font-weight: bold;
  font-size: 1.5em;
  color: #2b7cff !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
  padding: 0.1em 0;
}
.logo-top {
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.logo-bottom {
  font-size: 1em;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-top: -0.1em;
}
.nav-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-direction: row;
  flex-wrap: nowrap;
}
.nav-btn-group nav {
  display: flex;
  gap: 1.2rem;
}
.nav-btn-group .cta-btn {
  margin-left: 0;
}
nav {
  display: flex;
  gap: 1.2rem;
}
nav a {
  font-weight: 500;
  color: #23272f;
  padding: 0.3em 0.6em;
  border-radius: 0.4em;
  transition: background 0.2s, color 0.2s;
}
nav a:hover {
  background: #f0f6ff;
  color: #2b7cff;
}
.cta-btn,
button,
input[type="submit"] {
  background: #2b7cff;
  color: #fff;
  border-radius: 2em !important;
  text-align: center;
  font-weight: 600;
  padding: 0.4em 1.2em;
  display: inline-block;
  margin-left: 0;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.08);
  transition: background 0.2s, box-shadow 0.2s;
}
.cta-btn:hover,
button:hover,
input[type="submit"]:hover {
  background: #184e96;
  box-shadow: 0 4px 16px 0 rgba(43,124,255,0.13);
}

/* Unify button and select appearance for nav controls */
.language-select,
.cta-btn,
.country-btn {
  height: 2.4em;
  padding: 0.4em 1.2em;
  font-size: 1em;
  border-radius: 2em !important;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
.language-select option {
  font-size: 1em;
}

/* Country Dropdown */
.country-dropdown {
  position: relative;
  display: inline-block;
}
.country-btn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: #f0f6ff;
  color: #23272f;
  border-radius: 2em !important;
  padding: 0.4em 1em;
  font-size: 1em;
  cursor: pointer;
  border: 1px solid #e3e9f3;
  transition: border 0.2s;
}
.country-btn:hover, .country-btn:focus {
  border: 1px solid #2b7cff;
}
.country-list {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #e3e9f3;
  border-radius: 2em !important;
  min-width: 180px;
  box-shadow: 0 4px 16px 0 rgba(43,124,255,0.11);
  z-index: 10;
  padding: 0.3em 0;
}
.country-dropdown.open .country-list {
  display: block;
}
.country-option {
  display: flex;
  align-items: center;
  gap: 0.7em;
  width: 100%;
  background: none;
  border: none;
  padding: 0.7em 1em;
  font-size: 1em;
  cursor: pointer;
  color: #23272f;
  transition: background 0.2s;
  border-radius: 0.4em;
  box-shadow: none;
}
.country-option:hover {
  background: #f0f6ff;
  border-radius: 2em !important;
}
.flag-icon {
  display: inline-block;
  vertical-align: middle;
}
.flag-icon img {
  display: block;
  width: 22px;
  height: 16px;
}

/* Hero Section */
.hero {
  background: 
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 100%),
    url('images/bg.jpg') center center/cover no-repeat !important;
  padding: 6em 0 4em 0;
  text-align: center;
}
.hero-content h1,
.hero-content p {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hero-content h1 {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 0.5em;
}
.hero-content p {
  font-size: 1.15em;
  margin-bottom: 1.5em;
}
.highlight {
  color: #fff !important;
}

/* Listings Section */
.listings-section {
  margin: 2.5em 0 2em 0;
}
.listings-section h2 {
  font-size: 1.5em;
  color: #2b7cff !important;
  text-align: left;
  margin-left: 0;
  font-weight: 700;
  margin-bottom: 1em;
}
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5em;
}

/* Listing Card */
.listing-card {
  background: #fff;
  border-radius: 1em;
  padding: 1.5em 1.3em 1.2em 1.3em;
  box-shadow: 0 2px 12px 0 rgba(43,124,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  border: 1px solid #e3e9f3;
  transition: box-shadow 0.2s, border 0.2s;
  position: relative;
}
.listing-card:hover {
  box-shadow: 0 6px 32px 0 rgba(43,124,255,0.14);
  border: 1px solid #2b7cff33;
}
.listing-title {
  font-size: 1.2em;
  font-weight: 600;
  color: #23272f;
}
.listing-meta {
  color: #555;
  font-size: 0.98em;
}
.listing-contact {
  color: #2b7cff;
  font-weight: 500;
  font-size: 0.98em;
}
.listing-notes {
  color: #888;
  font-size: 0.95em;
  background: #f8fbff;
  border-radius: 0.5em;
  padding: 0.5em 0.8em;
}
.listing-image {
  width: 100%;
  border-radius: 0.8em;
  margin-bottom: 0.7em;
  object-fit: cover;
  min-height: 140px;
  max-height: 190px;
  background: #f6f8fa;
}
.badge-new {
  position: absolute;
  top: 1.1em;
  left: 1.1em;
  background: #2b7cff;
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
  border-radius: 1em;
  padding: 0.23em 0.9em;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.11);
  letter-spacing: 0.02em;
  z-index: 2;
}
.save-btn {
  position: absolute;
  top: 1.1em;
  right: 1.1em;
  background: #fff;
  border: 1px solid #e3e9f3;
  border-radius: 50%;
  width: 2.1em;
  height: 2.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2em;
  color: #2b7cff;
  transition: background 0.18s, color 0.18s;
}
.save-btn.saved {
  background: #2b7cff;
  color: #fff;
}

/* --- Modern Search Bar (Improved) --- */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8em;
  background: #fff;
  box-shadow: 0 2px 12px 0 rgba(43,124,255,0.06);
  border-radius: 2em;
  padding: 1.2em 1.5em 1.5em 1.5em;
  align-items: flex-end;
  margin: 1.2em auto 0.5em auto;
  max-width: 480px;
  justify-content: center;
  padding-left: 1em;
  padding-right: 1em;
}
.search-bar .search-input,
.search-bar .search-select {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 220px;
  border: 1px solid #e3e9f3;
  border-radius: 1.5em;
  padding: 0.7em 1.1em;
  font-size: 1em;
  background: #f8fbff;
  margin-bottom: 0;
}

.price-row {
  display: flex;
  gap: 0.6em;
  margin-bottom: 0.3em;
}
.price-row .search-price {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 0.7em;
  padding-right: 0.7em;
}
@media (max-width: 700px) {
  .price-row {
    flex-direction: column;
    gap: 0.25em;
  }
}

/* --- Filters & Sorting Bar (Improved) --- */
.filters-sort-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2em auto 1.3em auto;
  flex-wrap: wrap;
  gap: 1.2em;
  max-width: 900px;
}
.filters-group {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  justify-content: center;
}
.sort-group {
  display: flex;
  align-items: center;
  gap: 0.5em;
  justify-content: center;
}

@media (max-width: 900px) {
  .search-bar {
    padding-top: 1.1em;
    padding-left: 1.1em;
    padding-right: 1.1em;
    padding-bottom: 0.9em;
    flex-direction: column;
    align-items: stretch;
    max-width: 98vw;
    border-radius: 1.2em;
    box-shadow: 0 2px 8px 0 rgba(43,124,255,0.05);
    box-sizing: border-box;
  }
  .search-bar .search-input,
  .search-bar .search-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 2.1em !important;
    min-height: 2.1em !important;
    max-height: 2.1em !important;
    font-size: 1em !important;
    line-height: 1.2 !important;
    padding: 0.3em 0.8em !important;
    border-radius: 0.6em !important;
    box-sizing: border-box !important;
    appearance: none !important;
    margin-bottom: 0.3em !important;
    background: #f8fbff;
    display: block !important;
  }
  .hero-content > .cta-btn#browseListingsBtn {
    width: 100%;
    min-width: unset;
    margin: 0.6em 0 0 0;
    font-size: 1em;
    padding: 0.65em 0;
    border-radius: 1em;
  }
  .filters-sort-bar {
    flex-direction: column;
    gap: 0.7em;
    align-items: stretch;
    margin: 1.2em auto 1em auto;
  }
  .filters-group, .sort-group {
    justify-content: center;
  }
  .filter-pill {
    font-size: 1em;
    padding: 0.35em 1em;
    border-radius: 1em;
  }
  .hero-content .search-bar {
    margin-bottom: 0.3em;
  }
  .hero-content > .cta-btn#browseListingsBtn {
    margin-bottom: 1em;
  }
  .price-row {
    flex-direction: row !important;
    gap: 0.5em;
  }
  .price-row .search-price {
    min-width: 0;
    width: 50%;
    flex: 1 1 0;
    padding-left: 0.7em;
    padding-right: 0.7em;
  }
}

@media (max-width: 700px) {
  .container.nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 0.6em;
    padding-right: 0.6em;
    gap: 0;
  }
  .logo {
  }
  .nav-btn-group .cta-btn {
    padding: 0.4em 1.2em;
  }
  .country-dropdown {
    margin-right: 0.3em !important;
  }
  .language-select {
    min-width: 60px;
    max-width: 80px;
    font-size: 0.98em;
    padding-left: 0.6em;
    padding-right: 0.6em;
  }
  .listings-grid {
    grid-template-columns: 1fr;
    gap: 1em;
  }
  .cta-btn,
  #postListingBtn {
    padding-top: 0.7em;
    padding-bottom: 0.7em;
    min-height: 2.6em;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #postListingBtn {
    font-size: 0.98em;
    word-break: break-word;
    white-space: normal;
  }
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.15);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.modal-content {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem 2rem 2rem 2rem;
  min-width: 600px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 6px 32px 0 rgba(43,124,255,0.12);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 90vh;
  overflow-y: auto;
}
@media (max-width: 950px) {
  .modal-content {
    max-width: 98vw;
    min-width: unset;
    padding: 1.2rem;
  }
}
.modal-close {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  z-index: 10;
}
.modal-content h3 {
  margin: 0.2em 0 0.2em 0;
  padding: 0;
  text-align: left;
  font-size: 1.15em;
  font-weight: 600;
}
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.modal-content input,
.modal-content select,
.modal-content textarea {
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid #e3e9f3;
  font-size: 1rem;
  background: #f8fbff;
}
.modal-content textarea { min-height: 60px; resize: vertical; }
.modal-content form .cta-btn[type="submit"] {
  width: 100%;
  margin: 0.5em 0 0 0;
  align-self: stretch;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}
.comment-item { margin-bottom: 0.6rem; }
.comment-date { font-size: 0.88em; color: #aaa; margin-left: 0.6em; }
.no-comments {
  color: #888;
  font-style: italic;
  margin-top: 0.7em;
}

/* Footer */
footer {
  background: transparent;
  border-top: 1px solid #e3e9f3;
  padding: 1.5em 0 1.2em 0;
  text-align: center;
  color: #888;
  font-size: 1em;
}
.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1em;
}

/* Responsive */
@media (max-width: 700px) {
  .container.nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 0.6em;
    padding-right: 0.6em;
    gap: 0;
  }
  .logo {
  }
  .nav-btn-group .cta-btn {
    padding: 0.4em 1.2em;
  }
  .country-dropdown {
    margin-right: 0.3em !important;
  }
  .language-select {
    min-width: 60px;
    max-width: 80px;
    font-size: 0.98em;
    padding-left: 0.6em;
    padding-right: 0.6em;
  }
  .listings-grid {
    grid-template-columns: 1fr;
    gap: 1em;
  }
  #postListingBtn {
    font-size: 0.92em;
    padding-left: 1em;
    padding-right: 1em;
    min-width: 0;
    max-width: 110px;
    line-height: 1.1;
    word-break: break-word;
    white-space: normal;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

.filter-pill {
  background: #eaf3ff;
  color: #2b7cff;
  border: 1.5px solid #d3e4fa;
  border-radius: 2em;
  padding: 0.45em 1.3em;
  font-size: 1em;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.18s, color 0.18s, border 0.18s;
  box-shadow: none;
}
.filter-pill.active, .filter-pill:focus, .filter-pill:active {
  background: #2b7cff;
  color: #fff;
  border: 1.5px solid #2b7cff;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.11);
  outline: none;
}

/* --- Search Button Unified Styling (updated) --- */
.search-bar .search-btn {
  width: 100%;
  height: 2.7em;
  min-height: 2.7em;
  max-height: 2.7em;
  padding: 0;
  border-radius: 1em;
  font-size: 1.1em;
  font-weight: 700;
  background: #2b7cff;
  color: #fff;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.08);
  text-align: center;
  display: block;
  margin: 0;
  border: none;
  line-height: normal;
  transition: background 0.2s, box-shadow 0.2s;
}
.search-bar .search-btn:hover,
.search-bar .search-btn:focus {
  background: #184e96;
  box-shadow: 0 4px 16px 0 rgba(43,124,255,0.13);
}

/* --- Browse Listings Button Styling --- */
.cta-btn#browseListingsBtn {
  width: 100%;
  max-width: 480px;
  height: 2.7em;
  min-height: 2.7em;
  max-height: 2.7em;
  padding: 0;
  border-radius: 1em;
  font-size: 1.1em;
  font-weight: 700;
  background: #2b7cff;
  color: #fff;
  box-shadow: 0 2px 8px 0 rgba(43,124,255,0.08);
  text-align: center;
  display: block;
  margin: 0.6em auto 0 auto;
  border: none;
  line-height: normal;
  transition: background 0.2s, box-shadow 0.2s;
}
.cta-btn#browseListingsBtn:hover,
.cta-btn#browseListingsBtn:focus {
  background: #184e96;
  box-shadow: 0 4px 16px 0 rgba(43,124,255,0.13);
}

/* Custom File Input Styles */
.custom-file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1em;
}
#customFileBtn {
  background: #2b7cff;
  color: #fff;
  border-radius: 1em;
  padding: 0.5em 1.2em;
  border: none;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}
#customFileBtn:hover, #customFileBtn:focus {
  background: #184e96;
  box-shadow: 0 4px 16px 0 rgba(43,124,255,0.13);
}
#customFileText {
  color: #888;
  font-size: 0.98em;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}