/* --- 基本樣式重置與設定 --- */
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;margin:0;background-color:#f0f2f5;color:#333;line-height:1.5}
header{background-color:#181c53;color:#fff;padding:1rem;text-align:center;box-shadow:0 2px 4px rgba(0,0,0,.1)}
header h1{margin:0;font-size:1.5rem}
#user-profile{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:10px}
#user-picture{width:40px;height:40px;border-radius:50%;border:2px solid #fff}
main{padding:1rem}
#room-list-container h2{font-size:1.2rem;color:#333;margin-bottom:1rem}
.room-card{background-color:#fff;border-radius:12px;box-shadow:0 4px 12px rgba(0,0,0,.08);margin-bottom:1.5rem;overflow:hidden;transition:transform .2s ease-in-out}
.room-card:hover{transform:translateY(-5px)}
.room-card img{width:100%;height:200px;object-fit:cover;display:block}
.room-card-content{padding:1rem 1.25rem}
.room-card-content h3{margin-top:0;margin-bottom:.5rem;font-size:1.25rem;color:#1c1e21}
.room-card-content .price{font-size:1.2rem;font-weight:700;color:#ffc107;margin:.5rem 0}
.room-card-content .price span{font-size:.8rem;font-weight:400;color:#606770}
.room-card-content p{font-size:.9rem;color:#606770;margin-bottom:1rem}
.cta-button{display:block;width:100%;padding:12px;background-color:#181c53;color:#fff;border:none;border-radius:8px;font-size:1rem;font-weight:700;text-align:center;cursor:pointer;margin-top:1rem;text-decoration:none;transition:background-color .2s}
.cta-button:hover{background-color:#2a307a}
.cta-button:disabled{background-color:#ccc;cursor:not-allowed}
.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.6);display:flex;justify-content:center;align-items:center;z-index:1000;opacity:1;transition:opacity .3s ease}
.close-button{position:absolute;top:10px;right:15px;background:0 0;border:none;font-size:1.8rem;color:#aaa;cursor:pointer;transition:color .2s}
.close-button:hover{color:#333}
.form-group{margin-bottom:1.5rem}
.form-group label{display:block;margin-bottom:.5rem;font-weight:700;color:#333}
.form-group input[type=text],.form-group input[type=tel]{width:100%;padding:12px;border:1px solid #ccc;border-radius:8px;box-sizing:border-box;font-size:1rem}
.info-text{font-size:.9rem;color:#606770;margin-top:.5rem;min-height:1.2em}
.info-text.bold{font-weight:700;color:#1c1e21}
.error-text{color:#d9534f;font-size:.9rem;margin-top:.5rem;min-height:1.2em}
.hidden{display:none!important}
#loading-spinner{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,.9);display:flex;flex-direction:column;justify-content:center;align-items:center;z-index:2000}
.spinner{border:4px solid #f3f3f3;border-top:4px solid #181c53;border-radius:50%;width:40px;height:40px;animation:spin 1s linear infinite;margin-bottom:1rem}
@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

/* --- 日曆樣式 --- */
#app .datepicker-days .datepicker-cell.in-range:not(.start-date):not(.end-date) {
    background-color: #e4e5f0 !important;
    border-radius: 0 !important;
    color: #333 !important;
}
#app .datepicker-days .datepicker-cell.start-date {
    background-color: #181c53 !important;
    color: white !important;
    border-radius: 50px 0 0 50px !important;
}
#app .datepicker-days .datepicker-cell.end-date {
    background-color: #181c53 !important;
    color: white !important;
    border-radius: 0 50px 50px 0 !important;
}
#app .datepicker-days .datepicker-cell.start-date.end-date {
    border-radius: 50px !important;
}
#app .datepicker-days .datepicker-cell.in-range:not(.start-date):not(.end-date):hover {
    background-color: #d1d3e0 !important;
}
#app .datepicker-controls .prev-btn,
#app .datepicker-controls .next-btn {
    color: #181c53 !important;
}
#app .datepicker-controls .button {
    color: #181c53;
    font-weight: bold;
}

/* --- 我的訂單頁面專用樣式 --- */
#booking-list-container {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 0 10px;
}
.booking-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s ease-in-out;
}
.booking-card:hover {
    transform: translateY(-5px);
}
.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #eee;
}
.booking-card-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}
.status-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
}
.status-badge.status-pending_payment { background-color: #ff9800; }
.status-badge.status-confirmed { background-color: #4CAF50; }
.status-badge.status-cancelled { background-color: #f44336; }
.status-badge.status-completed { background-color: #607d8b; }
.booking-card-body {
    display: flex;
    padding: 20px;
    gap: 20px;
}
.booking-card-body img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
}
.booking-details p {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #555;
}
.booking-details p strong {
    color: #333;
    margin-right: 5px;
}
.booking-card-footer {
    padding: 15px 20px;
    text-align: right;
    background-color: #f7f7f7;
    border-top: 1px solid #eee;
}
.booking-card-footer .cancel-button {
    background-color: #f44336;
    border: none;
    padding: 8px 15px;
}
.booking-card-footer .cancel-button:hover {
    background-color: #d32f2f;
}
.back-button-container {
    text-align: center;
    margin-top: 30px;
}
#no-booking-message, .error-message {
    text-align: center;
    padding: 40px;
    color: #777;
    font-size: 1.1em;
}

/* --- 主導覽列樣式 --- */
.main-nav {
    display: flex;
    justify-content: center;
    background-color: #e4e5f0;
    padding: 10px 0;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.nav-link {
    padding: 10px 20px;
    margin: 0 5px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}
.nav-link:hover {
    background-color: #d1d3e0;
    color: #000;
}
.nav-link.active {
    background-color: #181c53;
    color: #fff;
    cursor: default;
}
header h1 {
    margin-bottom: 10px;
}

/* --- 訂房視窗樣式 --- */
#booking-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}
#booking-modal .modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}
#booking-modal .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}
#booking-modal .close-button:hover {
    color: #333;
}
#booking-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- 已取消訂單的特殊樣式 --- */
.booking-card.cancelled-card {
    opacity: 0.6;
    background-color: #f9f9f9;
}
.booking-card.cancelled-card .booking-card-body img {
    filter: grayscale(80%);
}

/* --- 訂單明細視窗樣式 --- */
.modal-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.modal-overlay .modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
#details-modal-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}
#details-modal-content ul {
    padding-left: 20px;
    line-height: 1.8;
    color: #555;
}
#details-modal-content hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* --- 可點擊的訂單卡片樣式 --- */
.booking-card.pending-card {
    cursor: pointer;
    border-left: 4px solid #ff9800;
}
.booking-card.pending-card:hover {
    background-color: #fffaf0;
}
.booking-card-footer .footer-note {
    font-size: 0.8em;
    color: #888;
    text-align: left;
    margin: 0;
}

/* --- 房型卡片上的價格摘要 --- */
.room-card-content .price-summary {
    font-size: 0.9rem;
    color: #606770;
    margin: 0.5rem 0 1rem 0;
    line-height: 1.4;
}

/* --- 房型卡片按鈕容器 --- */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
}

/* --- 次要按鈕樣式 (查看詳情) --- */
.cta-button.secondary {
    background-color: #e4e6eb;
    color: #333;
}
.cta-button.secondary:hover {
    background-color: #d8dbdf;
}

/* --- 房型詳細視窗樣式 --- */
#room-details-modal .modal-content.large {
    max-width: 800px;
    padding: 0;
    overflow: hidden;
}

/* --- 【關鍵修改】調整叉叉按鈕樣式 --- */
#room-details-modal .close-button {
    position: absolute; /* 相對於 modal-content 定位 */
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 40px; /* 設定固定寬度 */
    height: 40px; /* 設定固定高度 */
    border-radius: 50%; /* 變成圓形 */
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    color: #fff; /* 白色叉叉 */
    font-size: 28px; /* 加大叉叉字體 */
    font-weight: normal;
    line-height: 40px; /* 垂直置中 */
    text-align: center; /* 水平置中 */
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
#room-details-modal .close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1); /* 懸停時放大一點點 */
}


#details-content {
    display: flex;
    flex-direction: column;
}
@media (min-width: 768px) {
    #details-content {
        flex-direction: row;
        max-height: 80vh;
    }
}
.details-gallery {
    flex: 1.5;
    background-color: #f0f0f0;
}
.details-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.details-info {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}
.details-info h2 {
    margin-top: 0;
    font-size: 1.8rem;
}
.details-info .price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 1.5rem;
}
.details-info .description {
    font-size: 1rem;
    line-height: 1.6;
    color: #606770;
}
.details-info .cta-button {
    margin-top: 2rem;
}

/* --- 圖片輪播藝廊樣式 --- */
.details-gallery {
    position: relative;
    overflow: hidden;
}
.slide {
    display: none;
    width: 100%;
    height: 100%;
}
.slide.active {
    display: block;
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.gallery-nav:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }

/* --- 訂單明細中的聯絡資訊樣式 --- */
.contact-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f7f7f7;
    border-radius: 8px;
    border: 1px solid #eee;
}
.contact-info h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #333;
}
.contact-info p {
    margin: 5px 0;
    font-size: 0.95em;
}
.contact-info a {
    color: #007bff;
    text-decoration: none;
}
.contact-info a:hover {
    text-decoration: underline;
}
#close-details-modal {
    margin-top: 20px;
}