/* ==========================================
   17.1 日曆頂部時間選擇輪與確認控制列樣式
   ========================================== */
.calendar-top-bar {
    position: fixed;
    top: calc(50% - 260px);
    left: 50%;
    transform: translate(-50%, 34px) scale(0.94) translateZ(0);
    width: 90%;
    max-width: 460px;
    height: 60px;
    z-index: 3003;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
}

.calendar-top-bar.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1) translateZ(0);
    transition: transform 0.44s cubic-bezier(0.34, 1.38, 0.64, 1) 0.06s, opacity 0.24s ease 0.06s;
}

.calendar-time-bar {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 190px;
    height: 60px;
    border-radius: 18px;
    background: var(--calendar-bg);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), var(--glass-inner-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0 8px;
    overflow: visible;
}

.calendar-confirm-btn {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 18px;
    background: var(--calendar-bg);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), var(--glass-inner-highlight);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0;
    outline: none !important;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.35s ease;
}

.calendar-confirm-btn:active {
    transform: scale(0.9) translateZ(0) !important;
}

.calendar-confirm-btn.adjusted {
    background: var(--primary);
    border-color: var(--primary);
    color: #FAF6EE;
    box-shadow: 0 0 20px rgba(154, 135, 30, 0.55), 0 4px 16px rgba(154, 135, 30, 0.35);
}

@media (hover: hover) {
    .calendar-confirm-btn:hover {
        transform: scale(1.06) translateZ(0);
    }

    .calendar-confirm-btn.adjusted:hover {
        box-shadow: 0 0 24px rgba(154, 135, 30, 0.7), 0 4px 18px rgba(154, 135, 30, 0.45);
    }
}

.calendar-time-column {
    flex: 1;
    height: 60px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    z-index: 2;
}

.calendar-time-column:active {
    cursor: grabbing;
}

.calendar-time-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    will-change: transform;
    transform: translateY(15px);
}

.calendar-time-item {
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    opacity: 0.32;
    transition: opacity 0.15s ease, color 0.2s ease, transform 0.15s ease;
    transform: scale(0.9);
    pointer-events: none;
}

.calendar-time-bar.unadjusted-time .calendar-time-item.active {
    color: rgba(250, 246, 238, 0.5) !important;
    font-size: 19px;
    font-weight: 700;
    opacity: 1;
    transform: scale(1.15);
}

.calendar-time-bar.adjusted-time .calendar-time-item.active {
    color: var(--primary) !important;
    font-size: 19px;
    font-weight: 700;
    opacity: 1;
    transform: scale(1.15);
}

.calendar-time-colon {
    font-size: 18px;
    font-weight: 700;
    line-height: 60px;
    padding: 0 3px;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.2s ease;
}

.calendar-time-bar.unadjusted-time .calendar-time-colon {
    color: rgba(250, 246, 238, 0.5) !important;
}

.calendar-time-bar.adjusted-time .calendar-time-colon {
    color: var(--primary) !important;
}

@media (max-width: 768px) {
    .calendar-top-bar {
        top: calc(50% - 245px);
        width: 90%;
        max-width: 460px;
        height: 52px;
        gap: 8px;
    }

    .calendar-time-bar {
        min-width: 0;
        max-width: none;
        height: 52px;
        border-radius: 14px;
        padding: 0 6px;
    }

    .calendar-confirm-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        border-radius: 14px;
    }

    .calendar-time-column {
        height: 52px;
    }

    .calendar-time-item {
        font-size: 14px;
    }

    .calendar-time-bar.unadjusted-time .calendar-time-item.active,
    .calendar-time-bar.adjusted-time .calendar-time-item.active {
        font-size: 17px;
    }

    .calendar-time-colon {
        line-height: 52px;
        font-size: 16px;
        padding: 0 2px;
    }
}

