/* 1. 整體大背景改為淺粉色 */
body {
    background-color: #FFF0F5; /* 薰衣草紅/淺粉色 */
    font-family: 'Noto Serif TC', serif;
    color: #4A4A4A;
}

/* 2. 標題與內文調整 */
.temple-title {
    color: #8B0000; /* 深紅色標題，在粉紅背景上更清晰 */
    font-weight: bold;
    letter-spacing: 2px;
}

.description {
    color: #616161;
    line-height: 1.8;
}

/* 3. 卡片設計：增加白色基底以突顯內容 */
.donation-card {
    background-color: #FFFFFF; /* 卡片內部保持白色，避免視覺混亂 */
    border: 3px solid #D4AF37; /* 金色粗邊框 */
    padding: 10px;
    position: relative;
    box-shadow: 0 10px 20px rgba(255, 182, 193, 0.5); /* 粉色系的投影 */
    transition: all 0.3s ease;
}

.donation-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(255, 182, 193, 0.8);
}

/* 4. 內部邊框線 */
.card-inner {
    border: 1px solid #FFC0CB; /* 內線改為粉金色調 */
    padding: 25px 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 5. 六角形裁切樣式 */
.hexagon-box {
    width: 180px;
    height: 200px;
    background-color: #eee;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    overflow: hidden;
}

.hexagon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 6. 按鈕與裝飾 */
.btn-gold {
    background: linear-gradient(45deg, #D4AF37, #F9E498);
    border: none;
    color: #5D4037;
    font-weight: bold;
    padding: 10px 40px;
    box-shadow: 0 4px 0 #B8860B;
}

.btn-gold:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #B8860B;
}


/* =====================贊助項目列表頁====================== */
/* 粉紅色系大背景 */
body {
    background-color: #FFF0F5;
}

.temple-title {
    color: #8B0000;
}

/* 桌面版標題列樣式 */
.table-header {
    background-color: #D4AF37;
    color: white;
    padding: 12px 0;
    border-radius: 8px 8px 0 0;
}

/* 每一列的樣式 */
.table-row {
    background-color: white;
    border: 1px solid #FFC0CB;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px 0;
    transition: 0.3s;
}

.table-row:hover {
    background-color: #FFF5F7;
    border-color: #D4AF37;
}

.btn-gold {
    background-color: #D4AF37;
    color: white;
    border: none;
    padding: 5px 20px;
}

.btn-gold:hover {
    background-color: #B8860B;
    color: white;
}

/* --- 手機版自適應核心 (RDP) --- */
@media (max-width: 767.98px) {
    .table-row {
        text-align: left !important; /* 手機版靠左對齊 */
        padding: 15px;
        margin: 10px 5px;
    }

    .table-row [data-label]::before {
        content: attr(data-label); /* 這裡會抓取 HTML 裡的 data-label */
        font-weight: bold;
        color: #D4AF37;
        display: inline-block;
        width: 80px; /* 標籤寬度 */
    }

    /* 讓手機版的欄位各佔一行，不左右滑動 */
    .table-row > div {
        border-bottom: 1px dashed #eee;
        padding: 8px 0;
    }

    .table-row > div:last-child {
        border-bottom: none;
    }
}


/* =====================迷你分類====================== */
/* 設定主背景為粉紅色 */
.mini-section {
    background-color: #FFF0F5; /* 淺粉紅 */
    min-height: 200px;
}

/* 迷你卡片外框 */
.mini-card {
    background: white;
    border: 1px solid #D4AF37; /* 金色細邊 */
    padding: 5px;
    border-radius: 4px;
    transition: transform 0.2s;
}

.mini-card:hover {
    transform: scale(1.05);
    border-color: #8B0000; /* 懸停變深紅 */
}

/* 內部容器 */
.mini-card-inner {
    border: 1px solid #FFC0CB; /* 粉紅內線 */
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 迷你標題 */
.mini-title {
    color: #8B0000;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* 關鍵：六角形裁切 */
.mini-hexagon {
    width: 80px;  /* 迷你尺寸 */
    height: 90px;
    background-color: #eee;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    overflow: hidden;
}

.mini-hexagon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 特殊樣式：選中狀態 --- */
.active-category {
    border: 3px solid #8B0000 !important; /* 邊框變深紅色並加粗 */
    background-color: #FFF5F7 !important; /* 背景稍微亮一點 */
    transform: translateY(-5px); /* 向上浮起 */
    box-shadow: 0 8px 15px rgba(139, 0, 0, 0.2) !important; /* 增加紅色調陰影 */
    position: relative;
}

/* 選中時內框的變化 */
.active-category .mini-card-inner {
    border: 1px solid #D4AF37; /* 內線變金色 */
}

/* 選中時文字變更明顯 */
.active-category .mini-title {
    color: #8B0000;
    text-decoration: underline; /* 加上下劃線標記 */
}

/* 可選：在選中項目的角落加一個小圓點或標籤 */
.active-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #8B0000;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    border: 2px solid white;
}

/* 選中時六角形的縮放效果 */
.active-category .mini-hexagon {
    outline: 2px solid #D4AF37;
    outline-offset: 3px;
    transition: all 0.3s;
}

/* 移除超連結預設樣式 */
.category-link {
    text-decoration: none !important;
    display: block; /* 讓整個區域可點擊 */
    color: inherit;
}

/* 迷你卡片基礎樣式 */
.mini-card {
    background: white;
    border: 1px solid #D4AF37;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* --- 特殊樣式：Active 分類 --- */
.active-category {
    border: 3px solid #8B0000 !important; /* 顯眼的深紅邊框 */
    background-color: #FFF5F7 !important;
    transform: translateY(-3px);
}

/* 在 Active 狀態下，標題可以加粗或變色 */
.active-category .mini-title {
    color: #8B0000;
    font-weight: 800;
}

/* 六角形裝飾在 Active 時增加光暈 */
.active-category .mini-hexagon {
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
    border: 1px solid #D4AF37;
}

/* 滑過未選中的卡片時的效果 */
.category-link:hover .mini-card:not(.active-category) {
    border-color: #8B0000;
    transform: translateY(-2px);
}

/* =====================資料登記====================== */
/* 大背景粉紅色 */
body {
    background-color: #FFF0F5;
    font-family: 'Noto Serif TC', serif;
}

/* 表單白底容器 */
.form-container {
    background: #ffffff;
    border: 2px solid #D4AF37; /* 金色邊框 */
    padding: 30px;
    border-radius: 12px;
    max-width: 900px;
    margin: 0 auto;
}

/* 區塊標題 */
.form-section-title {
    color: #8B0000;
    font-weight: bold;
    border-left: 5px solid #D4AF37;
    padding-left: 10px;
    margin-top: 20px;
}

/* 輸入框樣式 */
.custom-input {
    border: 1px solid #FFC0CB; /* 粉紅邊框 */
    background-color: #FFF9FA;
}

.custom-input:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
    background-color: #fff;
}

/* 國旗小圖標背景 */
.bg-pink {
    background-color: #FFC0CB;
    border: 1px solid #FFC0CB;
    border-right: none;
}

/* 金色提交按鈕 */
.btn-submit {
    background-color: #D4AF37;
    color: white;
    font-weight: bold;
    border-radius: 50px;
    border: none;
    transition: all 0.3s;
}

.btn-submit:hover {
    background-color: #8B0000; /* 懸停變深紅 */
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.2);
}

.gold-line {
    opacity: 0.3;
    border-top: 2px solid #D4AF37;
}

/* 調整錯誤狀態的顏色，使其符合寺廟莊重感 */
.form-control.is-invalid {
    border-color: #dc3545; /* 保持標準紅或改為 #8B0000 */
    background-image: url("data:image/svg+xml,..."); /* Bootstrap 內建圖示 */
}

.invalid-feedback {
    color: #8B0000; /* 深紅色，在粉紅背景下辨識度高 */
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4px;
}

/* 確保 Input Group 錯誤時圓角正確 */
.input-group.has-validation > .form-control.is-invalid {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

/* --- 已選項目摘要樣式 --- */
.selected-item-box {
    background-color: #FFF5F7; /* 淺粉色背景 */
    border: 1px dashed #D4AF37; /* 金色虛線邊框 */
    padding: 15px 20px;
    border-radius: 8px;
}

.badge-item-label, .badge-price-label {
    font-size: 0.75rem;
    color: #8B0000;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
}

.item-name-display {
    color: #4A4A4A;
    font-weight: 700;
}

.item-price-display {
    color: #D4AF37; /* 金色金額 */
    font-weight: 800;
}

/* --- 捐款注意事項樣式 --- */
.notice-section {
    background-color: #fcfcfc;
    border-top: 2px solid #EEE;
    padding-top: 25px;
}

.notice-title {
    color: #8B0000;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.notice-list {
    padding-left: 1.2rem;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.8;
}

.notice-list li {
    margin-bottom: 8px;
    list-style-type: decimal; /* 使用數字排序 */
}

/* 讓注意事項在粉色背景中更明顯 */
.notice-list li::marker {
    color: #D4AF37;
    font-weight: bold;
}

/* 返回項目按鈕樣式 */
.btn-return-link {
    color: #8B0000; /* 深紅色 */
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 2px 10px;
    border: 1px solid #8B0000;
    border-radius: 20px;
    transition: all 0.3s ease;
    background-color: transparent;
}

.btn-return-link:hover {
    background-color: #8B0000;
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(139, 0, 0, 0.2);
}

/* 針對手機版的微調：確保標籤與金額在窄螢幕上不會擠在一起 */
@media (max-width: 576px) {
    .selected-item-box .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .text-end {
        text-align: left !important;
        margin-top: 15px;
    }
    .btn-return-link {
        margin-left: 0 !important;
        margin-top: 10px !important;
        display: inline-block;
    }
}

/* 認捐辦法容器 */
.border-gold {
    border: 1px solid #D4AF37;
    border-top: 5px solid #D4AF37;
}

/* 標題小標 */
.section-title {
    color: #8B0000;
    border-bottom: 2px solid #FFF0F5;
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-weight: bold;
}

.section-title-sm {
    color: #8B0000;
    font-weight: bold;
    font-size: 1rem;
}

.bg-gold {
    background-color: #D4AF37;
}

/* 文字內容 */
.notice-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

/* 建築項目標籤 */
.item-tag {
    background-color: #FFF9FA;
    border: 1px solid #FFC0CB;
    padding: 8px;
    font-size: 0.85rem;
    color: #8B0000;
    border-radius: 4px;
}

/* 繳款表格 */
.mini-table {
    font-size: 0.85rem;
}
.bg-pink-light {
    background-color: #FFF0F5;
}

/* 重要提示框 */
.important-box {
    background-color: #FFF5F7;
    border-left: 4px solid #8B0000;
    padding: 15px;
    color: #8B0000;
}

/* 強制顯示 Livewire 傳回的錯誤訊息 */
.invalid-feedback {
    display: block !important; /* 確保直接顯示 */
    color: #8B0000; /* 使用我們自定的深紅色 */
    font-size: 0.85rem;
    margin-top: 5px;
}

/* 讓輸入框變紅的同時，依然保有我們自定義的陰影效果 */
.custom-input.is-invalid {
    border-color: #dc3545 !important;
    background-color: #FFF5F5; /* 出錯時背景稍微變粉紅紅 */
}

.custom-input.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.2);
}

/* 懸浮按鈕容器 */
.fab-container {
    position: fixed;
    right: 20px;
    bottom: 30px;
    width: 70px;
    height: 70px;
    background-color: #8B0000; /* 深紅色底 */
    border: 2px solid #D4AF37; /* 金色外框 */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1050; /* 確保在最上層 */
    cursor: pointer;
}

/* 懸浮按鈕文字與圖示 */
.fab-icon {
    color: #FFFFFF;
    text-align: center;
    line-height: 1.2;
}

.fab-text {
    font-size: 0.75rem;
    font-weight: bold;
    display: block;
}

/* 筆數標籤 (Badge) */
.fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #D4AF37; /* 金色背景 */
    color: #8B0000; /* 深紅文字 */
    font-size: 0.85rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 滑過效果 */
.fab-cart-link:hover .fab-container {
    transform: scale(1.1) rotate(5deg);
    background-color: #A32626;
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.4);
}

/* 移除連結預設底線 */
.fab-cart-link {
    text-decoration: none !important;
}

/* 手機版縮小一點點 */
@media (max-width: 576px) {
    .fab-container {
        width: 60px;
        height: 60px;
        right: 15px;
        bottom: 20px;
    }
    .fab-text {
        font-size: 0.7rem;
    }
}

/* 容器維持原樣，但內部清單微調 */
.selected-item-box {
    background-color: #FFF5F7;
    border: 1px solid #D4AF37;
    padding: 20px;
    border-radius: 12px;
}

/* 每一列項目的名字 */
.item-name-display {
    color: #4A4A4A;
    font-size: 1rem;
}

/* 金額顯示 */
.item-price-display {
    color: #8B0000; /* 這裡改用深紅，總計感更強 */
    font-family: 'Verdana', sans-serif;
}

/* 總計橫列 */
.border-gold {
    border-color: #D4AF37 !important;
}

.total-amount-row {
    color: #8B0000;
}

/* 返回/增加項目按鈕樣式優化 */
.btn-return-link {
    color: #8B0000;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 12px;
    border: 1px solid #D4AF37;
    border-radius: 20px;
    background: white;
    transition: all 0.2s;
}

.btn-return-link:hover {
    background: #D4AF37;
    color: white;
}

/* 數量選擇器樣式 */
.qty-selector {
    width: fit-content;
}

.qty-selector .btn-outline-gold {
    border: 1px solid #D4AF37;
    color: #8B0000;
    background-color: transparent;
}

.qty-selector .btn-outline-gold:hover {
    background-color: #D4AF37;
    color: white;
}

.qty-selector .input-group-text {
    border-top: 1px solid #D4AF37;
    border-bottom: 1px solid #D4AF37;
    font-weight: bold;
    color: #8B0000;
    min-width: 40px;
    justify-content: center;
}

/* 僅顯示數量的粉紅標籤 */
.bg-pink {
    background-color: #FFF0F5 !important;
}

.border-gold {
    border-color: #D4AF37 !important;
}

/* 讓手機版顯示時金額跟數量並排 */
@media (max-width: 767.98px) {
    .qty-selector {
        transform: scale(0.9); /* 手機版稍微縮小 */
        transform-origin: left center;
    }
}

/* 刪除按鈕樣式 */
.btn-outline-danger {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.btn-outline-danger:hover {
    background-color: #fff5f5;
    color: #dc3545;
    transform: scale(1.1);
}

/* 針對 bi-dash 的備案處理 */
.bi-dash-lg::before, .bi-plus-lg::before {
    stroke-width: 2px; /* 增加粗度 */
}

/* 手機版排版優化 */
@media (max-width: 767.98px) {
    .item-price-display {
        font-size: 0.95rem;
    }
}

/* 隱藏 Chrome, Safari, Edge, Opera 的數字箭頭 */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 隱藏 Firefox 的數字箭頭 */
.qty-input[type=number] {
    -moz-appearance: textfield;
    border-top: 1px solid #D4AF37;
    border-left: 1px solid #D4AF37; /* 讓輸入框與按鈕一體化 */
    border-right: none;
    max-width: 50px;   /* 固定寬度防止跑版 */
    font-weight: bold;
    color: #8B0000;
}

.qty-input:focus {
    box-shadow: none;  /* 移除點擊時的藍色陰影 */
    border-color: #D4AF37;
    background-color: #FFF9FA;
}

.qty-selector .btn-outline-gold {
    z-index: 0; /* 防止邊框重疊導致線條粗細不一 */
}
