@charset "UTF-8";
/* 寬度控制 */
.my-calendar {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* ========================================
   月份切換滑動動畫
   ======================================== */
@keyframes cal-out-left {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(-30px); opacity: 0; }
}
@keyframes cal-out-right {
    from { transform: translateX(0);   opacity: 1; }
    to   { transform: translateX(30px); opacity: 0; }
}
@keyframes cal-in-from-right {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
@keyframes cal-in-from-left {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

.cal-slide-out-left     { animation: cal-out-left      0.2s  ease forwards; }
.cal-slide-out-right    { animation: cal-out-right     0.2s  ease forwards; }
.cal-slide-in-from-right { animation: cal-in-from-right 0.25s ease forwards; }
.cal-slide-in-from-left  { animation: cal-in-from-left  0.25s ease forwards; }

/* 月曆格子圓角 */
.my-calendar .fc-scrollgrid {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--fc-border-color, #ddd) !important;
}

/* FullCalendar 字型與整體系統對齊 */
.my-calendar,
.my-calendar .fc,
.my-calendar .fc * {
    font-family: inherit;
}

/* 日期數字 */
.my-calendar .fc-daygrid-day-number {
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
}

/* 日期下方、場次上方顯示當日已申請人數／上限，不佔用日期數字的版位 */
.day-quota-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: calc(100% - 6px);
    margin: 1px auto 3px;
    padding: 1px 4px;
    border: 1px solid #f3d66b;
    border-radius: 999px;
    background: #fff7cc;
    color: #795b00;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
}

.my-calendar .fc-daygrid-day.week-capped .day-quota-badge,
.my-calendar .fc-daygrid-day.past-date .day-quota-badge {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #6b7280;
}

/* 格子高度：壓 FullCalendar 內部 frame 的 min-height */
.my-calendar .fc-daygrid-day-frame {
    overflow: hidden;
}

.my-calendar-wrapper {
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

/* ========================================
   格子內 AM/PM 狀態 pills
   ======================================== */
.day-session-pills {
    display: flex;
    gap: 5px;
    padding: 0 3px 4px;
    flex-wrap: wrap;
}

.day-session-pill {
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 5px;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    transform: translateY(0);
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.day-session-pill.available {
    background: #c8e6c9;
    color: #1b5e20;
    border: 1px solid #87b68b;
}

.day-session-pill.available:hover {
    background: #a7dca9;
    border-color: #4f9d57;
    box-shadow: 0 2px 8px rgba(22, 101, 52, 0.2);
    transform: translateY(-1px);
}

.day-session-pill.full {
    background: #ffcdd2;
    color: #b71c1c;
    border: 1px solid #d18c8c;
}

.day-session-pill.full:hover {
    background: #fca5ad;
    border-color: #c45f67;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.18);
    transform: translateY(-1px);
}

/* 當天未開放的時段：僅佔位、不可點選 */
.day-session-pill.none {
    background: transparent;
    color: #b0bec5;
    border: 1px dashed #cfd8dc;
    cursor: default;
}

.day-session-pill.selected {
    background: #014f5a;
    border-color: #014f5a;
    color: #fff;
    box-shadow: 0 0 0 2px #014f5a inset;
    font-weight: 700;
}

.day-session-pill:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ========================================
   單週上限：整週日期反灰、場次不可申請
   ======================================== */
.my-calendar .fc-daygrid-day.week-capped {
    background-color: #eceff1;
}

.my-calendar .fc-daygrid-day.week-capped .fc-daygrid-day-number {
    color: #90a4ae;
}

/* 今天以前的日期不可申請 */
.my-calendar .fc-daygrid-day.past-date {
    background-color: #f3f4f6 !important;
}

.my-calendar .fc-daygrid-day.past-date .fc-daygrid-day-number {
    color: #9ca3af;
}

.day-session-pill.week-capped,
.day-session-pill.week-capped:hover {
    background: #e0e0e0;
    color: #8a8a8a;
    border-color: #c2c2c2;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.calendar-popup-actions {
    display: flex;
    gap: 10px;
}

.calendar-popup-actions .main-btn,
.calendar-popup-cancel {
    flex: 1 1 0;
}

.calendar-popup-cancel {
    padding: 10px;
    /* 按鈕邊界對比 ≥ 3:1（1.4.11）；原 #cbd5e1 僅 1.70:1 */
    border: 1.5px solid #6b7280;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
}

.calendar-popup-cancel:hover {
    background: #f8fafc;
    border-color: #6b7280;
}

.filter-alert-message:has(.calendar-selection-card) {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── 場次確認彈窗：內含整份海岸線資訊 ── */
/* 寬度沿用 .filter-alert-popup--form（560px），此處只處理資訊區的排版。
   彈窗本體的捲動已由 sidebar.css 的 flex 版型處理：header / footer 固定，
   只有 body 捲動，因此資訊再長也不會讓「確認場次」按鈕被推出畫面。 */
.session-info {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.session-info-intro {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    color: #014f5a;
    font-size: 1rem;
    font-weight: 600;
}

/* 資訊區的可摺疊標題在彈窗中排得較密，縮小區塊間距避免整體過長 */
.session-info .row {
    gap: 0.35rem;
}

.calendar-selection-copy {
    color: #475569;
    font-size: 1rem;
    font-weight: 400;
}

.calendar-selection-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid #b7e0e8;
    border-radius: 10px;
    background: #f8fcfd;
}

.calendar-selection-card--time {
    border-color: #c8dcf8;
    background: #f8fbff;
}

.calendar-selection-card--full {
    border-color: #fecaca;
    background: #fff5f5;
}

.calendar-selection-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

.calendar-selection-label i {
    color: #014f5a;
}

.calendar-selection-value {
    color: #014f5a;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.calendar-selection-card--time .calendar-selection-value {
    color: #003470;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

/* 場次確認彈窗：可自訂的淨灘起訖時間 */
/* 固定兩欄等寬；欄位是可壓縮的 select，窄螢幕（彈窗約 300px）仍放得下 */
.calendar-time-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.calendar-time-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.calendar-time-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.calendar-time-input {
    /* box-sizing + min-width:0：欄位有原生最小寬度，不歸零會把格線撐破 */
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    /* appearance:none：移除 iOS/Android 原生 select 樣式，改用自繪的下拉箭頭，兩欄才會等高等寬 */
    -webkit-appearance: none;
    appearance: none;
    padding: 7px 26px 7px 10px;
    border: 1px solid #c8dcf8;
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23003470'%3E%3Cpath d='M8 11.5 3.5 6.5h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px 12px;
    color: #003470;
    font-family: inherit;
    /* 16px：iOS Safari 在小於 16px 的表單控制項聚焦時會自動放大頁面 */
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    /* 數字等寬，兩欄時間視覺對齊 */
    font-variant-numeric: tabular-nums;
}

.calendar-time-input:focus-visible {
    outline: 2px solid #014f5a;
    outline-offset: 1px;
}

.calendar-time-input.is-invalid {
    border-color: #dc2626;
    background: #fff5f5;
}

.calendar-time-hint {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.4;
}

.calendar-time-error {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 600;
}

.calendar-time-error[hidden] {
    display: none;
}

.calendar-selection-card--full .calendar-selection-label i,
.calendar-selection-card--full .calendar-selection-value {
    color: #b91c1c;
}

.calendar-selection-card--full .calendar-selection-value {
    font-size: 1.22rem;
    font-weight: 700;
}

/* ========================================
   已額滿場次：開放民眾參與的出路
   ======================================== */
.calendar-public-invite {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid #cfe6c9;
    border-radius: 10px;
    background: #f5fbf3;
}

.calendar-public-invite-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2f6b34;
    font-size: 0.95rem;
    font-weight: 600;
}

.calendar-public-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #a8d3a0;
    border-radius: 9px;
    background: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.calendar-public-btn:hover {
    background: #f0f9ed;
    border-color: #6aa862;
    box-shadow: 0 2px 8px rgba(47, 107, 52, 0.16);
    transform: translateY(-1px);
}

.calendar-public-btn:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.calendar-public-btn-name {
    min-width: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 500;
    word-break: break-word;
}

.calendar-public-btn-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #2f6b34;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ========================================
   活動資料彈窗（民眾檢視，全欄位唯讀）
   ======================================== */
.calendar-public-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 14px;
}

/* 查看活動資料時，發起人員資訊橫跨唯讀資訊區兩欄。 */
.filter-alert-popup--form .app-public-readonly-item.calendar-public-readonly-item--full {
    grid-column: 1 / -1;
}

.calendar-public-detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.calendar-public-detail--full {
    grid-column: 1 / -1;
}

.calendar-public-detail-label {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 唯讀值仍給輸入框的視覺輪廓，維持與申請表單同一套版面節奏 */
.calendar-public-detail-value {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fbfdfe;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.calendar-public-detail-value .is-empty {
    color: #94a3b8;
}

.calendar-public-link {
    color: #00606f;
    text-decoration: underline;
}

.calendar-public-link:hover {
    color: #014f5a;
}

.calendar-public-link:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* 照片為主辦方自行上傳，比例不一，用 contain 避免裁掉圖上的字樣或 logo */
.calendar-public-photo {
    display: block;
    aspect-ratio: 16 / 9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.calendar-public-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .calendar-public-detail-grid {
        grid-template-columns: 1fr;
    }
}

.calendar-recommend-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    color: #014f5a;
    font-size: 1rem;
    font-weight: 600;
}

.calendar-recommend-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.calendar-recommend-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e3eef2;
    border-radius: 9px;
    background: #f8fcfd;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.calendar-recommend-item:hover {
    background: #eef9fc;
    border-color: #9bd7e4;
    box-shadow: 0 2px 8px rgba(1, 79, 90, 0.12);
    transform: translateY(-1px);
}

.calendar-recommend-item:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.calendar-recommend-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-recommend-name {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 500;
}

.calendar-recommend-location {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
}

.calendar-recommend-badge {
    flex: 0 0 auto;
    min-width: 34px;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.calendar-recommend-badge--low {
    color: #166534;
    background: #dcfce7;
}

.calendar-recommend-badge--medium {
    color: #92400e;
    background: #fef3c7;
}

.calendar-recommend-badge--high {
    color: #991b1b;
    background: #fee2e2;
}

/* ========================================
   legend 圖例
   ======================================== */
.calendar-legend {
    display: flex;
    flex-direction: column;
    margin: 6px 0;
    gap: 6px;
}

.legend-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 單週狀態獨立一組，用分隔線與單日狀態切開 */
.legend-group--week {
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
}

.legend-group-title {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

.legend-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
    justify-content: space-around;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-item > p {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    margin: 0;
    border-radius: 5px;
}

.legend-green {
    background-color: #dcfce7;
    color: #166534;
}
.legend-yellow {
    background-color: #fef9c3;
    color: #854d0e;
}
.legend-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.legend-quota-note {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
    font-size: 0.7rem;
    white-space: nowrap;
}

.legend-quota-sample {
    display: inline-block;
    padding: 1px 4px;
    border: 1px solid #f3d66b;
    border-radius: 999px;
    background: #fff7cc;
    color: #795b00;
    font-size: 0.62rem;
    font-weight: 700;
}

/* 單週狀態：用長橫條暗示作用範圍是一整列，而非單一格子 */
.legend-item--week {
    gap: 6px;
}

.legend-week-bar {
    display: block;
    width: 52px;
    height: 10px;
    border-radius: 3px;
    background-color: #eceff1;
    border: 1px solid #cfd8dc;
}

.legend-week-text {
    font-size: 0.8rem;
    margin: 0;
    color: #607d8b;
}


/* 年月標題顏色 */
.my-calendar .fc-toolbar-title {
    color: #014f5a;
    font-weight: 500;
    font-size: 1.3rem;
}

.fc-header-toolbar{
    margin-bottom: 0.5rem !important;
    background-color: #c2e9f2;
    padding: 8px;
    border-radius: 10px;
}


/* ========================================
   FullCalendar 工具列按鈕（圓形小按鈕）
   ======================================== */
.fc .fc-button {
    background: transparent !important;
    border: 1.5px solid #014f5a !important;
    color: #014f5a !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    transition: background 0.15s, color 0.15s;
}
.fc .fc-button:hover {
    background: #014f5a1a !important;
}
/* FullCalendar 預設在 :focus 疊一層粗 box-shadow，與本站圓形鈕造型衝突，故壓掉。
   但「不能」連 outline 一起拿掉——上下月切換鈕若無焦點外框，鍵盤使用者
   完全看不出目前位置（WCAG 2.4.7）。改為只壓 box-shadow，
   並明確補回 :focus-visible 外框（FC 樣式帶 !important，這裡也需要）。 */
.fc .fc-button:focus {
    box-shadow: none !important;
}
.fc .fc-button:focus-visible {
    outline: 2px solid #014f5a !important;
    outline-offset: 2px !important;
}

/* ========================================
   彈跳視窗 - 遮罩
   ======================================== */
.cal-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2500;
}

/* ========================================
   彈跳視窗 - 主體
   ======================================== */
.cal-day-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 14px;
    z-index: 2501;
    width: 90vw;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.cal-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #014f5a;
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
}

.cal-popup-close-x {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.1rem;
    opacity: 0.8;
}
.cal-popup-close-x:hover {
    opacity: 1;
}

.cal-popup-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* AM / PM 標籤列 */
.cal-popup-sessions {
    display: flex;
    gap: 0.5rem;
}

.session-tag {
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
}

.session-tag.available {
    background: #c8e6c9;
    color: #1b5e20;
}

.session-tag.full {
    background: #ffcdd2;
    color: #b71c1c;
}

/* 警示訊息 */
.cal-popup-warning {
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    padding: 0.45rem 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #6d4c00;
}

/* 區塊（分隔線） */
.cal-popup-section {
    border-top: 1px solid #eee;
    padding-top: 0.6rem;
}

.cal-popup-section-title {
    font-weight: bold;
    font-size: 0.88rem;
    color: #014f5a;
    margin: 0 0 0.4rem;
}

/* 已登記活動列表 */
.cal-popup-event-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.cal-event-name {
    flex: 1;
    font-weight: 500;
}

.cal-event-time {
    color: #6b7280;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* 推薦海岸區塊 */
.cal-popup-recommend {
    background: #f0f9ff;
    border-radius: 8px;
    padding: 0.6rem 0.75rem !important;
    border-top: none !important;
}

.cal-popup-beach-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
}

.beach-name {
    flex: 1;
    font-weight: 500;
}

.beach-city {
    color: #6b7280;
    font-size: 0.78rem;
}

.cal-apply-btn {
    font-size: 0.78rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    background: #c2e9f2;
    color: #014f5a;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.cal-apply-btn:hover {
    background: #a0d4e0;
}

/* 底部關閉按鈕 */
.cal-popup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
}
