:root {
    --fc-daygrid-day-number-font-size: 0.875rem;
    --fc-col-header-cell-cushion-font-size: 1rem;
    --fc-event-font-size: 0.75rem;
    --toolbar-title-font-size: 1.25rem;
    --toolbar-button-font-size: 1rem;
    --content-title-font-size: 1.25rem;
    --legend-text-font-size: 0.875rem;
    --footer-title-font-size: 1.25rem;
    --fc-today-button-font-size: 0.875rem;
    --color-pattern-dark-blue-1: #364153;
    --color-pattern-dark-blue-2: #1E2939;
    --fc-event-text-color: #4b515c;
    --fc-event-available-bg-color: #F3F4F6;
    --fc-legend-text-color: #333;
}

/* #region FullCalendar 客製化樣式 (利用 .fc 前綴提高權重，確保覆寫成功) */

/* --- 1. 每天的 1、2、3 純數字字體 --- */
/* 針對 dayGridMonth (月視圖) 的日期數字進行客製化 */
.fc .fc-daygrid-day-number {
    font-family: 'Montserrat', sans-serif;
    /* 範例：使用更流線的字體 */
    font-size: var(--fc-daygrid-day-number-font-size);
    /* 放大字體 */
    font-weight: 500;
    /* 字體加粗 */
    color: var(--color-pattern-dark-blue-1) !important;
    /* 設定數字顏色 */
    text-decoration: none !important;
    /* 移除預設的連結底線 */
    padding: 2px 6px;
    /* 調整數字周圍間距 */
}

/* --- 2. 標題週日、週一的星期標頭樣式 --- */

.fc .fc-scrollgrid-section-sticky > * {
    z-index: inherit;
}

.fc .fc-today-button {
    height: 36px;
    width: 68px;
    background: linear-gradient(90deg, #296BE0 0%, #515ADE 100%);
    border-radius: 10px;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-size: var(--fc-today-button-font-size);
    line-height: 20px;
    /* identical to box height, or 143% */
    text-align: center;
    color: #FFFFFF;
}

/* 針對工具列下方的星期一~星期日那一列 (dayHeader) */
.fc .fc-col-header-cell {
    padding: 8px 0 !important;
    border: 1px solid var(--color-pattern-dark-blue-2);
}

/* 設定標題列 (周一、周二...) */
.fc table tr:has(th.fc-col-header-cell.fc-day.fc-day-sun) {
    border-bottom: 2px solid #ddd;
    /* 底部加上分隔線 */
    border-right: 1px solid var(--color-pattern-dark-blue-2);
    background: linear-gradient(90deg, var(--color-pattern-dark-blue-1) 0%, var(--color-pattern-dark-blue-2) 100%);
}

/* 微調星期文字本身 */
.fc .fc-col-header-cell-cushion {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-size: var(--fc-col-header-cell-cushion-font-size);
    line-height: 24px;
    /* identical to box height, or 150% */
    text-align: center;
    color: #FFFFFF;
}

/* 針對自訂按鈕的各種狀態（預設、滑鼠懸停、點擊、聚焦）強制清除樣式 */
.fc .fc-myCustomSelectPlaceholder-button,
.fc .fc-myCustomSelectPlaceholder-button:hover,
.fc .fc-myCustomSelectPlaceholder-button:focus,
.fc .fc-myCustomSelectPlaceholder-button:active,
.fc .fc-myCustomSelectPlaceholder-button:disabled {
    background: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    display: contents !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    cursor: default !important;
}

    .fc .fc-myCustomSelectPlaceholder-button .form-group {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
    }

        /* 確保下拉選單被 tab 聚焦時，有標準的 focus 外框提示 */
        .fc .fc-myCustomSelectPlaceholder-button .form-group select.form-control:focus {
            outline: 2px solid #5957E0 !important;
            /* 使用您專案標題的紫色作為焦點框 */
            outline-offset: 2px;
            box-shadow: 0 0 0 3px rgba(89, 87, 224, 0.25) !important;
        }

        /* 額外微調：確保內嵌的 Bootstrap form-select 寬度與高度看起來自然 */
        .fc .fc-myCustomSelectPlaceholder-button .form-group select.form-control {
            cursor: pointer;
            /* 您可以根據需求，在這裡微調下拉選單的高度或寬度 */
            min-width: 150px;
        }

/* --- 3. 每個事件的通用樣式 --- */

/*  dayGridMonth (月視圖) 中的每一日區塊 */
.fc-daygrid-day-frame.fc-scrollgrid-sync-inner {
    padding: 12px;
}

.fc-daygrid-day-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fc .fc-daygrid-day-top {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

.fc .fc-event {
    cursor: pointer;
}

/* 針對 dayGridMonth (月視圖), timeGridDay (日視圖) 中的事件區塊 (.fc-event) */
.fc .fc-daygrid-event,
.fc .fc-timegrid-event {
    border: none;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: var(--fc-event-font-size);
}

/* 如果是全天事件 (有時會有不同的 class) */
.fc .fc-daygrid-block-event,
.fc .fc-timegrid-block-event {
    border: none;
    /* 移除全天事件的預設邊框 */
    margin-bottom: 1px;
    /* 全天事件之間的間距 */
}

/* 滑鼠懸停在事件上時的樣式 */
.fc .fc-daygrid-event:hover,
.fc .fc-timegrid-event:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* 增加浮起效果 */
    transform: translateY(-1px);
    /* 輕微向上移動 */
    transition: all 0.2s ease-in-out;
    /* 動畫過渡 */
}

/* 當鍵盤 Tab 聚焦到日曆事件時的視覺反饋 */
.fc .fc-daygrid-event:focus,
.fc .fc-timegrid-event:focus {
    outline: 2px solid #5957E0 !important;
    /* 顯眼的高對比紫色外框 */
    outline-offset: 1px;
    box-shadow: 0 0 8px rgba(89, 87, 224, 0.5) !important;
    /* 讓聚焦的事件稍微放大或突顯 */
    transform: translateY(-1px);
    background-color: rgba(0, 0, 0, 0.05);
    z-index: 5;
    /* 確保焦點框不會被隔壁的格子壓住 */
}

.fc .fc-daygrid-day.fc-day-today,
.fc .fc-list-event.fc-event-today {
    background-color: var(--fc-today-bg-color);
}

.fc-h-event .fc-event-main,
.fc-v-event .fc-event-main {
    padding: 0;
    height: 100%;
}

.fc-h-event .fc-event-main-frame,
.fc-v-event .fc-event-main-frame {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.fc-h-event .fc-event-title-container,
.fc-v-event .fc-event-title-container {
    flex-grow: 0;
    flex-shrink: 0;
}

/* 針對事件文字本身的微調 */
.fc .fc-event-title {
    font-weight: 500;
    /* 事件標題加粗 */
    overflow: hidden;
    /* 超出寬度自動隱藏 */
    text-overflow: ellipsis;
    /* 超出寬度顯示 "..." */
    white-space: nowrap;
    /* 強制事件標題不換行 */
}

/* 針對非本月日子的日期數字調整對比度 */
.fc .fc-day-other .fc-daygrid-day-top {
    opacity: 0.72;
    /* 微調透明度使其維持「非本月」的視覺層次，但確保可讀 */
}


/* --- 4. 上午/下午場地狀態樣式 --- */
.venue-morning,
.venue-afternoon,
.venue-allday {
    height: 28px;
    border-radius: 8px;
}

    .venue-morning.available,
    .venue-afternoon.available,
    .venue-afternoon.available {
        background-color: var(--fc-event-available-bg-color);
    }

/* --- 5. Header Toolbar --- */
.fc-header-toolbar {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

    .fc-header-toolbar > :nth-child(1) {
        justify-self: start;
    }

    .fc-header-toolbar > :nth-child(2) {
        justify-self: center;
    }

    .fc-header-toolbar > :nth-child(3) {
        justify-self: end;
    }

.fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fc-direction-ltr .fc-toolbar > * > :not(:first-child),
.fc-toolbar-title {
    margin-left: 0;
}

.fc-toolbar-title {
    font-weight: 600;
    font-size: var(--toolbar-title-font-size);
    /* identical to box height, or 155% */
    color: var(--color-pattern-dark-blue-2);
}

.fc-button.fc-prev-button,
.fc-button.fc-next-button {
    background-color: transparent;
    border: none;
    color: var(--color-pattern-dark-blue-2);
    font-size: var(--toolbar-button-font-size);
    padding: 5px 10px;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    /* 修正手機版畫面下的 header toolbar 的 column 配置 */
    .fc-header-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

        .fc-header-toolbar > :nth-child(3) {
            width: 100%;
            display: flex;
            justify-content: space-between;
        }

    /* 修正手機版畫面下的 daygrid event 與其容器樣式 */
    .fc-daygrid-event-harness .fc-event-main {
        display: none !important;
    }

    .fc-daygrid-event-harness a.fc-event {
        width: 10px !important;
        height: 10px !important;
        min-height: 10px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        margin: 4px auto !important;
        border: none !important;
    }

    .fc .fc-daygrid-body-natural .fc-daygrid-day-events {
        margin-bottom: 0 !important;
    }

    .fc .fc-daygrid-day-top {
        justify-content: center !important;
    }
}

/* #endregion */

/* #region Content styles */
.content-header {
    box-sizing: border-box;
    font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 12px;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #EDFAFF 0%, #FDF2F8 100%);
    border-left: 3.84615px solid #5957E0;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0px 10px 10px 0px;
}

    .content-header .content-title {
        font-family: 'Inter';
        font-style: normal;
        font-weight: 400;
        font-size: var(--content-title-font-size);
        line-height: 140%;
        /* or 28px */
        color: var(--color-pattern-dark-blue-1);
    }

.list-disc {
    list-style-type: disc;
    padding-inline-start: 25px;
}

    .list-disc li {
        line-height: 1.2;
    }

        .list-disc li:not(:last-child) {
            margin-bottom: 8px;
        }

.calendar-search-bar-container {
    display: flex;
    justify-content: space-between;
}

    .calendar-search-bar-container .location-select-field {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0px;
        gap: 11px;
    }

.content-footer {
    font-family: "Arial", "Helvetica Neue", Helvetica, sans-serif;
    /* Auto layout */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
    border-top: 2px solid #E5E7EB;
    margin-top: 30px;
}

    .content-footer .footer-title {
        font-family: 'Inter';
        font-style: normal;
        font-weight: 700;
        font-size: var(--footer-title-font-size);
        line-height: 28px;
        /* identical to box height, or 140% */
        color: var(--color-pattern-dark-blue-2);
    }

/* #endregion */

/* #region Calendar Legend */
/* 圖標最外層容器 */
.calendar-legend-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    /* 圖標列表，預設在寬螢幕水平排列，塞不下自動換行 */
    .calendar-legend-container .legend-list {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        /* 每個項目之間的間距 */
    }

    /* 單個圖標項目 */
    .calendar-legend-container .legend-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* 色塊本身 (呼叫 FullCalendar 事件的圓角與左側粗線設計) */
    .calendar-legend-container .legend-color-box {
        display: inline-block;
        width: 24px;
        height: 24px;
        border-radius: 4px;
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
        /* 微小的內陰影增加質感 */
    }

    /* 文字樣式 */
    .calendar-legend-container .legend-text {
        font-size: var(--legend-text-font-size);
        color: var(--fc-legend-text-color);
        font-weight: 500;
    }

/* 行動裝置最佳化：當螢幕太小時，自動改成垂直排列 */
@media (max-width: 576px) {
    .calendar-legend-container .legend-list {
        flex-direction: column;
        gap: 10px;
    }
}

/* #endregion */

/* Gap Utilities */

.gap-0 {
    gap: 0;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}
