/* ==========================================
   全域樣式與變數定義
   ========================================== */
:root {
    --primary-color: #4a6b5d;      /* 質感森林綠 */
    --primary-hover: #3d594d;      /* 深森林綠 */
    --secondary-color: #e8ede9;    /* 淡綠灰色 */
    --danger-color: #c97a7a;       /* 柔和紅 */
    --bg-color: #f3f6f4;           /* 背景淡灰綠 */
    --card-bg: #ffffff;            /* 卡片白色 */
    --text-main: #2c3e35;          /* 主文字 */
    --text-muted: #6e8277;         /* 輔助文字 */
    --border-color: #e1e7e3;       /* 邊框顏色 */
    --shadow-sm: 0 2px 8px rgba(74, 107, 93, 0.05);
    --shadow-md: 0 8px 24px rgba(74, 107, 93, 0.08);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1.5rem;
    min-height: 100vh;
}

/* ==========================================
   版面佈局 (Layout)
   ========================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 頂部標題區 */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.header-logo {
    font-size: 3rem;
    background: var(--secondary-color);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.header-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 主要內容區 (左右分欄) */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   卡片元件樣式 (Card)
   ========================================== */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(74, 107, 93, 0.05);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(74, 107, 93, 0.12);
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1.8rem;
    color: var(--primary-color);
    position: relative;
    padding-left: 0.8rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* ==========================================
   表單元素樣式 (Form)
   ========================================== */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

input, select, textarea {
    font-family: inherit;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #fafbfc;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 107, 93, 0.1);
}

textarea {
    resize: none;
}

/* ==========================================
   按鈕與徽章樣式 (Buttons & Badges)
   ========================================== */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 107, 93, 0.15);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 107, 93, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
}

.list-header .section-title {
    margin-bottom: 0;
}

.badge {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==========================================
   訂房清單與卡片 (List & Cards)
   ========================================== */
.booking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* 自訂捲軸樣式 */
.booking-list::-webkit-scrollbar {
    width: 6px;
}
.booking-list::-webkit-scrollbar-track {
    background: transparent;
}
.booking-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.booking-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 單個訂房紀錄卡片 */
.record-item {
    background-color: #fafbfc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.record-item:hover {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* 卡片上方資訊 */
.record-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guest-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.guest-icon {
    font-size: 1.2rem;
}

.guest-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
}

.room-badge {
    font-size: 0.8rem;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
}

/* 卡片詳細內容 */
.record-details {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    font-size: 0.88rem;
    gap: 0.5rem;
    color: var(--text-muted);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* 備註 */
.record-notes {
    font-size: 0.85rem;
    background-color: rgba(74, 107, 93, 0.04);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    color: var(--text-main);
    word-break: break-all;
}

/* 狀態 */
.loading-spinner {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    font-style: italic;
}

.no-records {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 0;
    font-size: 0.95rem;
}
/* ==========================================
   編輯與修改功能樣式
   ========================================== */
.btn-edit {
    position: absolute;
    right: 1.2rem;
    bottom: 1.2rem;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* 正在編輯中的卡片高亮樣式 */
.record-item.editing {
    border-color: var(--primary-color) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(74, 107, 93, 0.15) !important;
}

/* 微調卡片底部 padding，以容納修改按鈕 */
.record-item {
    padding-bottom: 3rem !important;
}
/* ==========================================
   輔助類別 (Helper Classes)
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
   後台登入驗證區塊樣式 (Admin Auth Block)
   ========================================== */
.admin-auth-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0.5rem;
    text-align: center;
    animation: fadeIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lock-icon {
    font-size: 2.8rem;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.admin-auth-block:hover .lock-icon {
    transform: scale(1.08) rotate(-10deg);
    background-color: var(--primary-color);
    color: #ffffff;
}

.auth-toggle-hint span:hover {
    color: var(--primary-hover) !important;
}

/* 簡單的淡入動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



