/* ==================== VTC 月曆專屬獨立樣式表 ==================== */
:root {
    --mint: #c8e6d7;
    --lavender: #e8d5f2;
    --yellow: #fef3c7;
    --coral: #f4a6a6;
    --charcoal: #2c3e50;
    --primary-color: #478ac9;
    --border-color: #ddd;
    --text-dark: #333;
    --text-light: #666;
    --holiday-red: #dc2626;
}

/* 確保全域與 Introduction.html 白底背景風格完美融合 */
.calendar-custom-section {
    background-color: #ffffff !important;
    padding-bottom: 60px;
}

/* 月份導航控制 */
.month-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 5px;
    margin-bottom: 25px;
}

.nav-button {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-button:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.month-display {
    text-align: center;
    min-width: 220px;
}

.month-display .year {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.month-display .month {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: 0.5rem;
}

/* 月曆卡片格線主體 */
.calendar-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin: 0 auto;
    max-width: 100%;
}

.weekday-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.weekday-header {
    text-align: center;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem;
}

.weekday-header.sunday {
    color: var(--holiday-red);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 115px;
    padding: 0.5rem;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    background: white;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.empty {
    background: #fafafa;
}

.calendar-day.holiday, .calendar-day.sunday {
    background: #fff8f8;
}

.day-number {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.day-number.holiday, .day-number.sunday {
    color: var(--holiday-red);
}

.holiday-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--holiday-red);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

/* 課程標籤晶片結構 */
.course-chips {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

/* 課程標籤晶片統一宣告 */
.course-chip {
    font-size: 0.72rem !important;
    font-weight: 600;
    padding: 3px 6px !important;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    
    /* 允許完整自動換行與高度彈性 */
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
    display: block !important;
    height: auto !important;
}


.course-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.course-chip.mint { background: var(--mint); color: #1e4620; }
.course-chip.lavender { background: var(--lavender); color: #4a1e5c; }
.course-chip.yellow { background: var(--yellow); color: #614e00; }
.course-chip.coral { background: var(--coral); color: white; }
.course-chip.skyblue { background: #bae6fd; color: #0369a1; }/* 天空藍 (Sky Blue) */
.course-chip.ocean { background: #cff4fc; color: #055160; }/* 海鹽藍 (Sea Salt Blue)*/
.course-chip.slate { background: #e2e8f0; color: #334155; }/* 灰藍色 (Slate) */
.course-chip.purple { background: #ddd6fe; color: #4c1d95; }/* 深紫羅蘭 (Violet) */
.course-chip.matcha { background: #dcfce7; color: #14532d; }/* 抹茶綠 (Matcha Green) */
.course-chip.ice { background: #e0f2fe; color: #075985; }/* 冰晶藍 (Ice Blue) */
.course-chip.peach { background: #ffedd5; color: #9a3412; }/* 蜜桃橙 (Peach)  */
.course-chip.pink { background: #fce7f3; color: #831843; }/*玫瑰粉 (Rose Pink) */
.course-chip.tea { background: #f5e6d3; color: #5c3d2e; }/* 奶茶棕 (Milk Tea) */
.course-chip.grey { background: #f1f5f9; color: #475569; }/* 中性水泥灰 (Soft Grey) */


/* 資訊彈窗 (Modal Popup) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 12px 36px rgba(0,0,0,0.25);
}

.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.6rem; cursor: pointer; color: #aaa;
}
.modal-close:hover { color: #333; }

.modal-image {
    width: 100% !important;
    max-height: 250px !important; /* 限制大圖最大高度，避免撐爆視窗 */
    height: auto !important;
    object-fit: contain !important; /* 保留圖片整體，不裁切畫面 */
    border-radius: 6px;
    margin-bottom: 1.25rem;
    border: 1px solid #eee;
    display: block;
}

.modal-title {
    font-size: 1.4rem; font-weight: 700;
    margin-bottom: 1rem; color: var(--primary-color);
}

.modal-info { margin-bottom: 0.6rem; font-size: 0.95rem; color: #333; }
.modal-info strong { color: #555; }

.modal-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    border: none;
    cursor: pointer;
}
.modal-button:hover { background: #3b75ab; color: white; }

/* 行動裝置優化 */
@media (max-width: 768px) {
    .calendar-day { min-height: 85px; }
    .weekday-header { font-size: 0.85rem; padding: 0.5rem; }
    .course-chip { font-size: 0.65rem; }
}

/* =================================================== */
/* 絕對強制：彈窗右下角橘色按鈕樣式 */
/* =================================================== */

/* 確保彈窗內容本體是定位基準，並騰出底部空間 */
.modal-content {
    position: relative !important;
    padding-bottom: 70px !important; /* 留出底部高度給按鈕 */
}

/* 將按鈕容器絕對定位到整個彈窗的右下角 */
.modal-footer-action-block {
    position: absolute !important;
    bottom: 25px !important;
    right: 30px !important;
    display: block !important;
    text-align: right !important;
}

/* 橘色粗邊框按鈕本體 */
.modal-content a.custom-orange-btn {
    display: inline-block !important;
    border: 3px solid #ff8533 !important;   /* 橘色粗邊框 */
    background-color: #ffffff !important;    /* 純白背景 */
    color: #ff8533 !important;               /* 橘色文字 */
    padding: 8px 24px !important;            /* 按鈕內襯大小 */
    font-size: 16px !important;
    font-weight: bold !important;
    text-decoration: none !important;        /* 去除下底線 */
    border-radius: 4px !important;           /* 微圓角 */
    transition: all 0.2s ease-in-out !important;
}

/* 滑鼠移上去時的發光變色效果 */
.modal-content a.custom-orange-btn:hover {
    background-color: #ff8533 !important;    /* 背景變橘色 */
    color: #ffffff !important;               /* 文字變白色 */
    text-decoration: none !important;
}

/* =================================================== */
/* 橫幅圖片控制：限制最大寬度，防止圖片過大 */
/* =================================================== */
.calendar-banner-img {
    display: block !important;
    max-width: 800px !important; /* 💡 限制圖片最大寬度與月曆格子相近 */
    width: 90% !important;        /* 手機版時會自動縮小 */
    height: auto !important;
    margin: 25px auto 10px !important; /* 置中，並調整上下間距 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important; /* 精緻陰影 */
    border-radius: 6px !important; /* 微圓角 */
}
/* =================================================== */
/* 💡 解決課程名稱展示不全：自動換行與字體調整 */
/* =================================================== */

/* 1. 增加月曆格子的最低高度，確保多行文字放得下 */
.calendar-day {
    min-height: 110px !important;
}

/* 2. 強制讓課程膠囊 (Course Chip) 能夠自動換行，不再截斷文字 */
.course-chip {
    white-space: normal !important;        /* 允許文字自動換行 */
    word-break: break-word !important;    /* 遇到長單字/括號時自動斷行 */
    font-size: 0.72rem !important;        /* 稍微調小字體，畫面更精緻 */
    line-height: 1.25 !important;         /* 緊密行高，節省空間 */
    padding: 3px 6px !important;          /* 內邊距調整 */
    display: block !important;            /* 強制區塊顯示 */
    height: auto !important;              /* 高度隨文字多少自動撐開 */
}
/* =================================================== */
/* 📱 手機端 (Mobile Responsive) 深度優化 */
/* =================================================== */
@media (max-width: 575px) {
    /* 1. 調整月曆格子高度與邊距，防止畫面撐爆 */
    .calendar-day {
        min-height: 75px !important;
        padding: 2px !important;
    }
    
    .weekday-header {
        font-size: 0.75rem !important;
        padding: 0.3rem 0 !important;
    }

    .day-number {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }

    .holiday-name {
        font-size: 0.55rem !important;
    }

    /* 2. 縮小課程標籤，適應小螢幕 */
    .course-chip {
        font-size: 0.58rem !important;
        padding: 2px 3px !important;
        line-height: 1.1 !important;
        border-radius: 2px !important;
    }

    /* 3. 調整月導航列 */
    .month-display .year {
        font-size: 1.3rem !important;
    }
    
    .month-display .month {
        font-size: 1.2rem !important;
    }

    .nav-button {
        width: 32px !important;
        height: 32px !important;
        font-size: 1rem !important;
    }

    /* 4. 彈窗 (Modal) 在手機上的完美縮放 */
    .modal-content {
        width: 92% !important;
        padding: 1.2rem 1.2rem 65px 1.2rem !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }

    .modal-title {
        font-size: 1.15rem !important;
    }

    .modal-info {
        font-size: 0.85rem !important;
    }

    .modal-footer-action-block {
        bottom: 15px !important;
        right: 15px !important;
    }

    .modal-content a.custom-orange-btn {
        padding: 6px 16px !important;
        font-size: 14px !important;
    }
}