/* ------------------------ 網頁基本設定 ------------------------ */
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;
  transition: 0.3s;
}

.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;
}

/* ------------------------ 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-align: center;
}

.hero-content h1 {
  font-size: 64px;
  text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
}

/* ===== 「陪伴外出」平台樣式 ===== */
.companion-wrapper {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.companion-header {
  text-align: center;
  margin-bottom: 40px;
}

.companion-header h2 {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-top: 0;
}

.companion-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.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;
  font-weight: 500;
}

.filter-btn:hover {
  background-color: #e9e9e9;
  border-color: #bbb;
}

.filter-btn.active {
  background-color: #2a8491;
  color: white;
  border-color: #2a8491;
}

.request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* --- 卡片樣式 --- */
.request-card {
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #eee;
  cursor: pointer;
}

.request-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.request-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.request-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.request-card-tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 12px;
  color: white;
  margin-bottom: 12px;
}
.request-card-tag.shared-ride { background-color: #fd6f6f; } /* 更新顏色 */
.request-card-tag.shopping { background-color: #64B5F6; }
.request-card-tag.leisure { background-color: #81C784; }

.request-card-destination {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 12px 0;
  color: #333;
  line-height: 1.4;
  flex-grow: 1;
}

.request-card-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
  margin-top: auto;
  font-size: 14px;
  color: #777;
}

.request-card-user {
  font-weight: bold;
}

/* --- 新增需求按鈕 --- */
#add-request-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 60px;
  height: 60px;
  background-color: #2a8491;
  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-request-btn:hover {
  background-color: #1d5c64;
  transform: scale(1.1);
}

/* --- Modal 通用樣式 --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* --- 新增需求 Modal --- */
.request-form {
  background: white;
  padding: 30px 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-backdrop:not(.hidden) .request-form {
    transform: scale(1);
}
.request-form h3 {
  margin: 0 0 25px 0;
  text-align: center;
  font-size: 22px;
}
.request-form form { margin-top: 25px; }
.request-form input, .request-form select, .request-form textarea {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.request-form input:focus, .request-form select:focus, .request-form textarea:focus {
    outline: none;
    border-color: #2a8491;
    box-shadow: 0 0 0 3px rgba(42, 132, 145, 0.2);
}
.request-form textarea { resize: vertical; min-height: 100px; }
.request-form .form-row { display: flex; gap: 16px; }
.request-form .button-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 10px; }
.request-form button { padding: 12px 25px; font-size: 16px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
.request-form button[type="submit"] { background-color: #f0c837; color: white; }
.request-form button[type="submit"]:hover { background-color: #d8b431; transform: translateY(-2px); }
#cancel-btn { background-color: #f0f0f0; border: 1px solid #ddd; }
#cancel-btn:hover { background-color: #e5e5e5; }

/* --- 【修改】需求詳情 Modal --- */
.detail-request-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-backdrop:not(.hidden) .detail-request-modal {
    transform: scale(1);
}

.detail-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    font-weight: normal;
    color: #888;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
.detail-close-btn:hover {
    color: #333;
}

.detail-modal-content {
    padding: 30px 35px;
    overflow-y: auto;
}

.detail-modal-tag {
    align-self: flex-start;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
    margin-bottom: 12px;
}
.detail-modal-tag.shared-ride { background-color: #9E9E9E; } /* 更新顏色 */
.detail-modal-tag.shopping { background-color: #64B5F6; }
.detail-modal-tag.leisure { background-color: #81C784; }

.detail-modal-title {
    margin: 0 0 15px 0;
    font-size: 26px;
    font-weight: bold;
    color: #333;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}
.meta-divider {
    color: #ddd;
}

.detail-modal-description {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap;
}

.detail-modal-content hr {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 25px 0;
}

/* --- 【全新樣式】聯絡方式容器的兩種狀態 --- */
.contact-container-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background-color: #f0c837;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}
.contact-container-button:hover {
    background-color: #d8b432;
}

.contact-container-info {
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
    text-align: left;
    transition: all 0.3s ease;
}
.contact-container-info p {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 14px;
}
.contact-container-info strong {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}
/* ------------------------ Footer (全站共用) ------------------------ */
.site-footer {
  background-color: #b4b4b4;
  color: #333;
  padding: 30px 20px 10px;
  font-size: 14px;
  margin-top: 60px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo img {
  height: 70px;
}

.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;
}