/* Simple Course Calendar — 自訂樣式 */

#scc-calendar {
    max-width: 1100px;
    margin: 20px auto;
}

.scc-course-list-container {
    width: 100%;
    max-width: 1100px;
    margin-block: 40px;
    margin-inline: auto;
    /* 距離原本是 20px，調整為 40px */
    font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;

    /* FC6 變數 - 控制邊框 */
    --fc-border-color: #ddd;
    /* 保留預設值，但下方會覆寫 */
    --fc-page-bg-color: #fff;
    --fc-neutral-bg-color: #fff;
    /* 標題列背景 - 紫色主題保留白色 */
    --fc-list-event-hover-bg-color: #f5f5f5;
}

/* 行事曆標題樣式 */
.fc-toolbar-title {
    font-size: 1em;
    font-weight: 700;
    color: var(--scc-title-color, #333);
}

/* 按鈕組 - 主題色藥丸樣式 */
.fc .fc-button-primary {
    background-color: var(--scc-primary-color, #9b59b6);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.75em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 0;
    transition: background-color 0.2s;
    box-shadow: none;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
    background-color: var(--scc-primary-hover, #8e44ad);
    border: none;
    box-shadow: none;
}

.fc .fc-button-primary:active,
.fc .fc-button-primary:not(:disabled):active {
    background-color: var(--scc-primary-active, #7d3c98);
    border: none;
    box-shadow: none;
}

.fc .fc-button-primary:disabled {
    background-color: var(--scc-primary-disabled, #c39bd3);
    border: none;
    opacity: 0.7;
}

/* 今天按鈕 - 同樣樣式 */
.fc .fc-today-button {
    margin-right: 0;
    background-color: var(--scc-primary-color, #9b59b6);
    border: none;
    color: #fff;
}

.fc .fc-today-button:disabled {
    background-color: var(--scc-primary-disabled, #c39bd3);
}

/* 按鈕組藥丸形狀 */
.fc .fc-toolbar .fc-button-group {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    /* 確保按鈕水平排列 */
    vertical-align: middle;
}

/* 單一按鈕也採用藥丸形狀 */
.fc .fc-toolbar .fc-today-button {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* 按鈕組間的微妙分隔線 */
.fc .fc-button-group .fc-button-primary+.fc-button-primary {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.fc-header-toolbar {
    margin-bottom: 1em !important;
    align-items: center;
}

/* ===================================================================
   美化與修正格線
   =================================================================== */

/* 1. 重置：強制覆寫 WP 主題的表格樣式 */
#scc-calendar table,
#scc-calendar thead,
#scc-calendar tbody,
#scc-calendar tfoot,
#scc-calendar tr,
#scc-calendar td,
#scc-calendar th {
    border: 0 !important;
    border-style: none !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 2. 強制邊框與紫色主題 */

/* 2. 強制邊框與紫色主題 */

/* 全域變數（可由後台設定覆蓋） */
:root {
    --scc-primary-color: #9b59b6;
    /* 主題色 */
    --scc-primary-hover: #8e44ad;
    /* 主題色（hover） */
    --scc-primary-active: #7d3c98;
    /* 主題色（active） */
    --scc-primary-disabled: #c39bd3;
    /* 主題色（disabled） */
    --scc-border-color: #e1d4e6;
    /* 邊框顏色 */
    --scc-title-color: #333;
    /* 標題文字色 */
    --scc-today-bg: rgba(255, 252, 220, 0.5);
    /* 今日背景色，這也是預設值 */

    /* 向後相容別名與內部變數 */
    --scc-purple-light: var(--scc-border-color);
    /* 獨立行事曆文字顏色，若無自訂則預設讀取主題色 */
    --scc-purple-text: var(--scc-calendar-text, var(--scc-primary-color));

    /* 確保 FullCalendar 的今日背景色能吃到全域變數 */
    --fc-today-bg-color: var(--scc-today-bg) !important;
}

/* 外層結構 */
#scc-calendar .fc-scrollgrid {
    border: 1px solid var(--scc-purple-light) !important;
    border-radius: 4px;
    /* 外層圓角 */
    overflow: hidden;
}

/* 欄位標題（週一、週二....） */
#scc-calendar .fc-col-header-cell {
    border-right: 1px solid var(--scc-purple-light) !important;
    border-bottom: 1px solid var(--scc-purple-light) !important;
    background-color: #fff;
    /* 白色背景配合紫色文字 */
}

/* 標題文字樣式 */
#scc-calendar .fc-col-header-cell-cushion {
    display: inline-block;
    padding: 8px 4px;
    /* 更好的垂直間距 */
    color: var(--scc-purple-text) !important;
    /* 紫色文字 */
    font-weight: 600;
    text-decoration: none;
    text-transform: none;
    /* 若需遏免大寫可用此覆寫 */
    font-size: 1em;
    /* 統一字體大小 */
    letter-spacing: normal;
}

/* 日期儲存格（1, 2, 3...） */
#scc-calendar .fc-daygrid-day {
    border-right: 1px solid var(--scc-purple-light) !important;
    border-bottom: 1px solid var(--scc-purple-light) !important;
}

/* 修正「今天」醒目提示 - 確保可見 */
#scc-calendar .fc-day-today {
    background-color: var(--fc-today-bg-color) !important;
}

/* 日期數字 */
#scc-calendar .fc-daygrid-day-number {
    font-size: 1em;
    /* 統一字體大小 */
    padding: 8px 8px;
    /* 乾淨的間距 */
    color: var(--scc-purple-text) !important;
    /* 主題色文字 */
    text-decoration: none;
    font-weight: 500;
}

/* 3. 移除重複邊框 */
#scc-calendar .fc-scrollgrid-section>td {
    border: none !important;
}

#scc-calendar .fc-col-header-cell:last-child,
#scc-calendar .fc-daygrid-day:last-child {
    border-right: none !important;
}

#scc-calendar .fc-daygrid-body tr:last-child .fc-daygrid-day {
    border-bottom: none !important;
}

#scc-calendar .fc-scrollgrid-section-body>td {
    border-bottom: none !important;
}

#scc-calendar td[role="presentation"] {
    border: none !important;
}

/* ===================================================================
   事件區塊樣式（月曆卡片）
   =================================================================== */
#scc-calendar .fc-event {
    border: none !important;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 1px !important;
    margin-top: 1px !important;
    margin-left: 1px !important;
    /* 最小間距 */
    margin-right: 1px !important;
    /* 最小間距 */
}

#scc-calendar .fc-event-main {
    padding: 2px 4px;
    /* 縮小事件內部間距 */
    font-size: 1em;
    /* 事件文字大小 */
    line-height: 1.3;
}

/* 「已額滿」、「因故停止報名」與「課程結束」月曆檢視樣式 */
.fc-event.scc-event-full,
.fc-event.scc-event-stopped,
.fc-event.scc-event-ended {
    opacity: 0.6 !important;
    filter: grayscale(100%) !important;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.05),
        rgba(0, 0, 0, 0.05) 8px,
        transparent 8px,
        transparent 16px
    ) !important;
}

.fc-event.scc-event-full .fc-event-title,
.fc-event.scc-event-full .fc-event-time,
.fc-event.scc-event-stopped .fc-event-title,
.fc-event.scc-event-stopped .fc-event-time,
.fc-event.scc-event-ended .fc-event-title,
.fc-event.scc-event-ended .fc-event-time {
    text-decoration: line-through;
    text-decoration-thickness: 4px;
    text-decoration-color: rgba(0, 0, 0, 0.4);
    color: #b0b0b0;
}

/* 「即將滿班」月曆檢視樣式 */
.fc-event.scc-event-almost-full {
    box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.5); /* 橘色內陰影提示 */
}

/* 「自訂標籤」月曆檢視樣式 (中性提示) */
.fc-event.scc-event-custom-status {
    box-shadow: inset 0 0 0 2px rgba(71, 85, 105, 0.4); /* 深莫蘭迪藍灰內陰影 */
}

/* 讓事件文字可以換行，避免被裁切 (截斷) */
#scc-calendar .fc-daygrid-event {
    white-space: normal !important;
    align-items: normal !important;
}

#scc-calendar .fc-event-title {
    white-space: normal !important;
    word-break: break-word;
}

/* 事件垂直居中？否，維持置頂對齊是標準做法 */

/* ===== 消除捲軸 ===== */
#scc-calendar .fc-scroller,
#scc-calendar .fc-scroller-liquid,
#scc-calendar .fc-scroller-liquid-absolute {
    overflow: visible !important;
    position: relative !important;
}

#scc-calendar .fc-scroller-harness {
    overflow: visible !important;
}

/* ===================================================================
   課程列表（現代卡片式清單）
   =================================================================== */

/* 標題列與月份導覽 */
/* 課程列表標題區域佈局 */
.scc-course-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto 15px auto;
    max-width: 1100px;
    flex-wrap: wrap;
    gap: 10px;
}

.scc-course-list-header h3 {
    margin: 0;
}

.scc-list-status {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #888;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.scc-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scc-custom-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 自訂課程列表導覽 - 極簡箭頭樣式 */
.scc-custom-nav .fc-button-primary {
    background-color: transparent !important;
    border: none !important;
    color: #333 !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    margin: 0 !important;
}

.scc-custom-nav .fc-button-primary:hover {
    background-color: transparent !important;
    /* 滑鼠懸停時無背景 */
    color: #000 !important;
    opacity: 0.7;
    /* 微調透明度作為互動回饋 */
    transform: none !important;
}

.scc-custom-nav .fc-button-primary:active,
.scc-custom-nav .fc-button-primary:not(:disabled):active {
    background-color: transparent !important;
    /* 按下時無背景 */
    color: #000 !important;
    opacity: 0.5;
    box-shadow: none !important;
}

.scc-custom-nav .fc-button-primary:disabled {
    background-color: transparent !important;
    color: #ccc !important;
    opacity: 1 !important;
}

/* 移除分隔線 */
.scc-custom-nav .fc-button-group .fc-button-primary+.fc-button-primary {
    border-left: none !important;
}

/* 調整圖示大小/粗細 */
.scc-custom-nav .fc-icon {
    font-size: 2em !important;
    /* 從 1.5em 加大 */
    vertical-align: middle;
    font-weight: 700;
    /* 加粗圖示使其更顯眼 */
}




.scc-course-list {
    max-width: 1100px;
    margin: 15px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scc-no-events {
    text-align: center;
    padding: 30px;
    color: #888;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 1.1em;
}

/* 事件項目容器 */
.scc-event-item {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* 微妙的卡片陰影 */
    border: 1px solid #eee;
    padding: 12px 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.scc-event-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* 1. 日期欄（左側） */
.scc-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding-right: 20px;
    border-right: 1px solid #f0f0f0;
    margin-right: 20px;
    color: #333;
}

.scc-date-num {
    font-size: 2.5em;
    /* 從 2em 加大 */
    font-weight: 700;
    line-height: 1;
    color: #222;
}

.scc-date-week {
    font-size: 1.1em;
    /* 從 0.85em 加大 */
    color: #666;
    margin-top: 2px;
    font-weight: 500;
}

/* 2. 資訊欄（中間） */
.scc-event-info {
    flex: 1;
    /* 佔滿剩餘空間 */
    display: flex;
    flex-direction: column;
    gap: 0;
}

.scc-event-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
    font-weight: 600;
    line-height: 1.6;
}

/* 狀態標籤容器（標題下方齊左） */
.scc-status-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.scc-btn-tag-full {
    display: inline-block;
    padding: 1px 6px;
    background-color: #fee2e2;
    color: #ef4444;
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-almost {
    display: inline-block;
    padding: 1px 6px;
    background-color: #fef3c7;
    color: #f59e0b;
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-stopped {
    display: inline-block;
    padding: 1px 6px;
    background-color: #f3f4f6; /* 淺灰色 */
    color: #4b5563; /* 深灰色 */
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-ended {
    display: inline-block;
    padding: 1px 6px;
    background-color: #f3f4f6; /* 淺灰色（同 stopped） */
    color: #4b5563; /* 深灰色（同 stopped） */
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-custom {
    display: inline-block;
    padding: 1px 6px;
    background-color: #f0f4f8; /* 淺莫蘭迪灰藍 */
    color: #475569; /* 深莫蘭迪藍灰 */
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-confirmed {
    display: inline-block;
    padding: 1px 6px;
    background-color: #dcfce7; /* 淺綠 */
    color: #166534; /* 深綠 */
    font-size: 0.7em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-btn-tag-hot {
    display: inline-block;
    padding: 2px 8px;
    background-color: #ffedd5; /* 淺粉橘 */
    color: #c2410c; /* 深橘紅 */
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 4px;
    vertical-align: middle;
}

.scc-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.95em;
    color: #666;
    margin-top: -4px;
}

.scc-event-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    /* 粗體 */
    font-size: 1.1em;
    /* 加大字體 */
    color: #333;
    /* 深色強調 */
}

.scc-event-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.scc-event-time i,
.scc-event-location i {
    font-size: 14px;
    line-height: 1;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.scc-event-location {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    color: #333;
    padding: 1px 8px 1px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}

.scc-event-location i {
    font-size: 1.15em;
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px;
    margin-right: -2px;
}

/* 3. 操作欄（右側） */
.scc-event-action {
    margin-left: 20px;
}

.scc-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* 從 4px 加大以增加間距 */
    padding: 6px 12px;
    background-color: #bbb;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: normal;
    /* 重設行高以改善 Flex 置中效果 */
}

/* 按鈕懸停樣式 */
.scc-event-btn:hover {
    background-color: var(--scc-purple-text);
    color: #fff !important;
    text-decoration: none !important;
}

.scc-event-btn i {
    font-size: 13px;
    /* 從 14px 縮小 */
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    position: relative;
    top: 0;
    /* 桌面版重設為 0（微調向上位移） */
}

/* 響應式 - 手機堆疊排列 */
@media (max-width: 768px) {
    .scc-event-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        position: relative;
    }

    .scc-event-date {
        flex-direction: row;
        /* 手機版：日期與星期橫向並排 */
        align-items: baseline;
        gap: 8px;
        border-right: none;
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
        padding-right: 0;
        justify-content: flex-start;
        border-bottom: 1px solid #f5f5f5;
        padding-bottom: 10px;
    }

    .scc-date-num {
        font-size: 3.5em;
        /* 從 2.8em 加大 */
        line-height: 1;
        position: relative;
        top: 4px;
        /* 微調向下位移 */
    }

    .scc-date-week {
        font-size: 1em;
        /* 從 1.2em 縮小 */
        font-weight: 500;
        margin-left: 6px;
        /* 微調間距，gap 已處理大部分 */
    }

    .scc-event-info {
        width: 100%;
        gap: 4px;
        /* 從 10px 縮小，減少標題與資訊間的距離 */
    }

    .scc-event-meta {
        flex-direction: row;
        /* 從直排改為橫排 */
        flex-wrap: wrap;
        /* 允許換行 */
        align-items: center;
        /* 垂直置中對齊 */
        gap: 10px;
        /* 時間與地點之間的間距 */
    }

    .scc-event-action {
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
        text-align: right;
        /* 按鈕靠右對齊 */
    }

    .scc-event-btn {
        width: 100%;
        /* 滿版寬度方便手機點擊 */
        text-align: center;
        display: flex;
        /* 改用 Flex 以保持對齊一致 */
        justify-content: center;
        /* 內容置中 */
    }

    /* 手機版圖示微調 */
    .scc-event-btn i {
        top: -1px;
        /* 手機版圖示維持稍高的位置 */
    }
}

/* ===== 月份標題 ===== */
.scc-month-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0 4px;
    margin-bottom: 0;
}

.scc-month-year {
    font-size: 1.5em;
    /* 從 1.3em 加大 */
    color: #555;
    font-weight: 700;
}

.scc-month-num {
    font-size: 1.5em;
    /* 從 1.3em 加大 */
    font-weight: 700;
    color: #333;
}

.scc-month-count {
    font-size: 1.5em;
    /* 從 1.3em 加大 */
    color: #888;
    margin-left: 4px;
    font-weight: 700;
}

.scc-month-sep {
    display: inline-block;
    width: 48px;
    height: 0;
    border-top: 2px solid #bbb;
    vertical-align: middle;
    position: relative;
    top: -5px;
}

/* ===== 週分隔線 ===== */
.scc-week-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 2px;
}

.scc-week-label {
    font-size: 1.2em;
    /* 從 0.8em 加大 */
    font-weight: 700;
    /* 加粗至 700 與月份一致 */
    color: var(--scc-purple-text);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.scc-week-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #ccc, transparent);
    opacity: 0.5;
}

/* 跨月週標題 */
.scc-cross-month-week .scc-week-label {
    color: #bbb;
}

.scc-cross-month-week .scc-week-line {
    background: linear-gradient(to right, #ddd, transparent);
    opacity: 0.5;
}

/* ===== 跨月事件 ===== */
.scc-cross-month-event {
    opacity: 0.5;
}

.scc-cross-month-event:hover {
    opacity: 0.8;
}

/* ===================================================================
   「顯示全部」切換開關
   =================================================================== */
.scc-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    margin-right: 10px;
}

.scc-toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin-bottom: 0;
}

.scc-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.scc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.scc-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.scc-slider {
    background-color: var(--scc-primary-color, #9b59b6);
    /* 主題色 Toggle */
}

input:checked+.scc-slider:before {
    transform: translateX(16px);
}

.scc-toggle-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.scc-location-filter {
    font-size: 0.9em;
    /* 與切換標籤一致 */
    font-weight: 600;
    color: #555;
    padding: 6px 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}