/* ==========================================================================
   山屋豆 / 小屋咖啡 專屬月曆 前台完美模擬樣式表 (修復右下角正圓點定位版)
   ========================================================================== */

.sw-calendar-wrapper {
    max-width: 650px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
    background-color: #ffffff;
    padding: 20px;
}

/* 1. 頭部排版 (左邊大寫月份與小字標題，右邊年份與英文月份) */
.sw-calendar-header {
    display: table;
    width: 100%;
    margin-bottom: 30px;
}
.sw-header-left, .sw-header-right {
    display: table-cell;
    vertical-align: bottom;
}
.sw-header-right {
    text-align: right;
}

.sw-zh-month {
    font-size: 56px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: -1px;
    margin-right: 15px;
}
.sw-sub-title {
    font-size: 20px;
    color: #333333;
    letter-spacing: 1px;
}
.sw-year {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.2;
}
.sw-en-month {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #1a1a1a;
    line-height: 1;
}

/* 2. 星期欄位排版 */
.sw-calendar-weekdays {
    display: table;
    width: 100%;
    table-layout: fixed;
    margin-bottom: 25px;
    text-align: center;
}
.sw-calendar-weekdays > div {
    display: table-cell;
    padding: 5px 0;
}
.sw-calendar-weekdays div {
    font-size: 20px;
    font-weight: bold;
    color: #1a1a1a;
}
.sw-calendar-weekdays .en-w {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #666666;
    margin-top: 4px;
}
/* 六日顏色特殊處理 */
.sw-calendar-weekdays .sat-w div,
.sw-calendar-weekdays .sat-w .en-w {
    color: #d76a40 !important;
}
.sw-calendar-weekdays .sun-w div,
.sw-calendar-weekdays .sun-w .en-w {
    color: #e26d4a !important;
}

/* 3. 日期網格排版 (7欄) */
.sw-calendar-days-grid {
    display: block;
    width: 100%;
    font-size: 0; /* 消除 inline-block 空隙 */
}
.sw-day-cell {
    display: inline-block;
    width: 14.285%;
    text-align: center;
    vertical-align: middle;
    margin-bottom: 18px;
    position: relative;
}

/* 圓圈核心樣式 */
.sw-day-circle {
    display: inline-block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 18px;
    font-weight: 300;
    border-radius: 50%;
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: #f5f5f5; /* 預設為淡淡的灰色圓圈 */
    position: relative !important; /* 🌟 讓黑色圓圈自身成為定位基準點 */
    box-sizing: border-box;
}

/* 空白格不顯示圈 */
.sw-empty .sw-day-circle {
    display: none;
}

/* ==========================================================================
   4. 營業日樣式
   ========================================================================== */

/* 只要是營業日 (status = 1, 2, 3)，均保持黑色實心圓、白字 */
.sw-day-cell.sw-is-business .sw-day-circle,
.sw-day-cell[data-biz-status="1"] .sw-day-circle,
.sw-day-cell[data-biz-status="2"] .sw-day-circle,
.sw-day-cell[data-biz-status="3"] .sw-day-circle {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
    font-weight: bold;
    text-shadow: none;
}

/* ==========================================================================
   5. 表演活動（綠色）樣式 與 完美正圓疊加效果
   ========================================================================== */

/* 5-1. 純表演活動（當天無咖啡營業）：整顆為綠色實心圓、白字 */
.sw-day-cell.sw-is-music:not(.sw-is-business)[data-biz-status="0"] .sw-day-circle,
.sw-day-cell.sw-is-music:not(.sw-is-business) .sw-day-circle {
    background-color: #6bab7a !important;
    background: #6bab7a !important;
    color: #ffffff !important;
    font-weight: bold;
    cursor: pointer;
}

/* 5-2. 🌟 關鍵修正：確保綠色圓點一定是「絕對正圓形」且完美貼在黑色大圓右下角 */
.sw-day-cell .sw-event-badge {
    position: absolute !important;
    right: 2px !important;              /* 緊貼黑色大圓內側右邊 */
    bottom: 2px !important;             /* 緊貼黑色大圓內側下邊 */
    width: 12px !important;             /* 採用固定像素，確保是 1:1 正方形 */
    height: 12px !important;            /* 高度與寬度一致 */
    background-color: #6bab7a !important; /* 音樂會主題綠色 */
    border-radius: 50% !important;       /* 強制渲染為完美正圓 */
    border: 2px solid #ffffff !important;/* 白色邊框，提升堆疊對比感 */
    box-sizing: content-box !important;
    pointer-events: none !important;    /* 避免阻擋點擊事件 */
    z-index: 10 !important;             /* 確保層級在大圓上方 */
}

/* 5-3. 活動當天的滑鼠懸停放大效果 */
.sw-is-music .sw-day-circle:hover {
    transform: scale(1.08);
    cursor: pointer;
}

/* ==========================================================================
   6. Tooltip 滑鼠懸停泡泡提示效果
   ========================================================================== */
[data-tooltip]:not([data-tooltip=""])::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30, 30, 30, 0.95);
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 999;
}
[data-tooltip]:not([data-tooltip=""]):hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ==========================================================================
   7. 月曆下方排版與控制按鈕
   ========================================================================== */
.sw-calendar-footer {
    margin-top: 35px;
    border-top: 1px solid #eeeeee;
    padding-top: 25px;
}
.sw-footer-info {
    float: left;
}
.sw-footer-nav {
    float: right;
    margin-top: -2px;
}
.sw-calendar-footer::after {
    content: "";
    display: block;
    clear: both;
}

.sw-time-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
}

/* 前台切換月份按鈕設計 */
.sw-nav-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 10px;
    transition: all 0.2s ease;
}
.sw-nav-btn:hover:not(:disabled) {
    background: #8c7662;
}
.sw-nav-btn:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
}

/* 圖例項目共通樣式 */
.legend-item {
    display: flex;
    align-items: center;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* 利用偽元素繪製下方圖例的圓點 */
.legend-item::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

/* 圖例顏色定義 */
.legend-black::before {
    background-color: #000000;
}
.legend-green::before {
    background-color: #6bab7a;
}

/* ==========================================================================
   8. 響應式手機版排版微調
   ========================================================================== */
@media screen and (max-width: 767px) {
    .sw-day-circle {
        width: 34px;
        height: 34px;
        line-height: 34px;
        font-size: 13px;
    }
    .sw-day-cell .sw-event-badge {
        right: 1px !important;
        bottom: 1px !important;
        width: 9px !important;
        height: 9px !important;
        border-width: 1.5px !important;
    }
    .sw-zh-month {
        font-size: 39px;
        display: block;
        margin-bottom: 5px;
    }
    .sw-sub-title {
        font-size: 17px;
    }
    .sw-calendar-footer {
        margin-top: 15px;
    }
    .legend-item {
        align-items: flex-start;
    }
    .legend-item::before {
        margin-top: 3px;
    }
}