/* ------------------------ 網頁基本設定 ------------------------ */
body {
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  background-color: #fdf6dc;
  color: #333;
}

/* ------------------------ 導覽列 Header (全站共用) ------------------------ */
header {
  background-color: #fdf6dc;
  padding: 10px 30px;
  border-bottom: 1px solid #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 0 40px;
}

.left-group {
  display: flex;
  align-items: center;
  gap: 36px;
}

.navbar-links {
  flex: 1.5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 50px;
  padding-left: 275px;
}

nav a {
  font-size: 20px;
  text-decoration: none;
  color: #887d00;
  font-weight: bold;
  padding: 6px 12px;
}

nav a:hover {
  color: #2a8491;
  text-decoration: underline;
}

.buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.buttons a {
  padding: 6px 12px;
  border-radius: 6px;
  background-color: #f0c837;
  color: white;
  text-decoration: none;
  font-size: 14px;
}

a.logo {
  text-decoration: none;
  color: inherit;
}

/* ------------------------ Logo 共用樣式 ------------------------ */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 75px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  text-align: left;
}

.logo-title {
  font-size: 30px;
  font-weight: bold;
  white-space: nowrap;
}

.logo-blue {
  color: #418693;
}

.logo-orange {
  color: #f37c3a;
}

.logo-subtitle {
  font-size: 20px;
  color: #21414C;
  margin-top: 2px;
  font-weight: bold;
}

.user-display {
  font-weight: bold;
  color: #333;
}


/* ------------------------ Hero 區塊 ------------------------ */
.hero {
  position: relative;
  height: 750px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.4);
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
}

.hero-content h1 {
  font-size: 63px;
}

/* ===== 「共居媒合平台」樣式 ===== */
.platform-wrapper {
  display: flex;
  max-width: 1600px;
  margin: 60px auto;
  gap: 40px;
  padding: 0 40px;
}

.map-container {
  flex: 1;
  background-color: #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  height: 80vh;
  position: sticky;
  top: 100px;
}

.listing-container {
  flex: 1;
  min-width: 400px;
}

.listing-header {
  margin-bottom: 20px;
  text-align: center;
}

.listing-header h2 {
  font-size: 28px;
  margin: 0 0 20px 0;
}

.listing-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.filter-btn {
  padding: 8px 18px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background-color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: #f0f0f0;
}

.filter-btn.active {
  background-color: #f37c3a;
  color: white;
  border-color: #f37c3a;
}

.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.listing-card {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #eee;
  overflow: hidden; /* 確保圓角效果 */
  transition: all 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
}

.listing-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.listing-card-content {
  padding: 24px;
  border-left: 5px solid;
}

.listing-card.provide .listing-card-content {
  border-left-color: #418693;
}

.listing-card.seek .listing-card-content {
  border-left-color: #f0c837;
}

.listing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 10px;
}

.listing-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 0;
  flex: 1;
}

.listing-card-type {
  font-size: 14px;
  font-weight: bold;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.listing-card.provide .listing-card-type {
  background-color: #418693;
}

.listing-card.seek .listing-card-type {
  background-color: #f0c837;
  color: #555;
}

.listing-card-location {
  font-size: 15px;
  color: #777;
  margin: 8px 0 12px;
}

.listing-card-description {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
}

.listing-card-user {
  font-size: 14px;
  color: #aaa;
  text-align: right;
  margin-top: 16px;
}

#add-listing-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 60px;
  height: 60px;
  background-color: #f37c3a;
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  transition: all 0.3s ease;
}

#add-listing-btn:hover {
  background-color: #d96d31;
  transform: scale(1.1);
}

/* Modal 樣式 (已修正) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex; /* <-- 已修改 */
  align-items: center;
  justify-content: center;
}
/* 新增這個 class 來配合 JS 的邏輯 */
.modal-backdrop.hidden {
  display: none;
}

.listing-form {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 550px;
}
.listing-form h3 {
  margin-top: 0;
  text-align: center;
}
.listing-form form {
  margin-top: 25px;
}
.listing-form input,
.listing-form select,
.listing-form textarea {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}
.listing-form textarea {
  resize: vertical;
}
.listing-form .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}
.listing-form button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.listing-form button[type="submit"] {
  background-color: #f37c3a;
  color: white;
}
#cancel-btn {
  background-color: #ccc;
}
.listing-form label {
    font-size: 14px;
    color: #555;
    display: block;
    margin-bottom: 8px;
}
.listing-form input[type="file"] {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font-size: 14px;
}
.listing-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: none;
    background: #f0c837;
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
}
.listing-form input[type="file"]::file-selector-button:hover {
    background: #e0b827;
}


/* ------------------------ Footer (全站共用) ------------------------ */
.site-footer {
  background-color: #b4b4b4;
  color: #333;
  padding: 30px 20px 10px;
  font-size: 14px;
}
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-links a {
  display: block;
  color: #424242;
  text-decoration: none;
  margin: 4px 0;
}
.footer-links a:hover {
  text-decoration: underline;
}
.footer-contact p {
  margin: 4px 0;
}
.footer-bottom {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid #999;
  padding-top: 10px;
  font-size: 12px;
  color: #666;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.footer-links .link-row {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ------------------------ RWD 響應式設計 ------------------------ */
@media (max-width: 992px) {
  .platform-wrapper {
    flex-direction: column;
  }
  .map-container {
    position: static;
    height: 300px;
    top: 0;
  }
}