/* assets/css/booking-calendar.css — Booking.com Style Dual-Month Calendar Range Picker */

.tt-calendar-wrapper {
    position: relative;
    user-select: none;
}

/* Trigger Field Styling */
.tt-date-range-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 52px;
}

.tt-date-range-trigger:hover {
    border-color: #006ce4;
    background: #f8fafc;
}

.tt-calendar-wrapper.is-open .tt-date-range-trigger {
    border-color: #006ce4;
    box-shadow: 0 0 0 3px rgba(0, 108, 228, 0.15);
}

.tt-trigger-icon {
    font-size: 18px;
    color: #475569;
    flex-shrink: 0;
}

.tt-trigger-body {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
    flex: 1;
}

.tt-trigger-label {
    font-size: 10.5px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.tt-trigger-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Floating Popover */
.tt-calendar-popover {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    z-index: 999999 !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    width: 680px !important;
    max-width: 95vw !important;
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
    padding: 20px 24px !important;
    display: none !important;
    animation: ttCalendarFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box !important;
}

.tt-calendar-wrapper.is-open .tt-calendar-popover,
.tt-calendar-popover.is-open {
    display: block !important;
}

/* Smart Dropup when space below is limited */
.tt-calendar-popover.dropup {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    box-shadow: 0 -20px 45px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.08) !important;
    animation: ttCalendarFadeInUp 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes ttCalendarFadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* If popover is right-aligned */
.tt-calendar-popover.align-right {
    left: auto !important;
    right: 0 !important;
}

@keyframes ttCalendarFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Popover Top Tabs */
.tt-cal-tabs {
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.tt-cal-tab {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    padding: 4px 2px;
    position: relative;
    transition: color 0.15s;
}

.tt-cal-tab:hover {
    color: #006ce4;
}

.tt-cal-tab.active {
    color: #006ce4;
}

.tt-cal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    right: 0;
    height: 3px;
    background: #006ce4;
    border-radius: 3px 3px 0 0;
}

/* Dual Month Container */
.tt-cal-months {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
}

/* Individual Month */
.tt-cal-month {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

/* Month Header */
.tt-cal-month-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    min-height: 32px !important;
}

.tt-cal-month-title {
    font-size: 14.5px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    text-align: center !important;
    flex: 1 !important;
}

.tt-cal-nav-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #334155;
    font-size: 13px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.tt-cal-nav-btn:hover {
    background: #006ce4;
    color: #ffffff;
    border-color: #006ce4;
}

.tt-cal-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
}

/* Days of Week Row */
.tt-cal-weekdays {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    margin-bottom: 6px !important;
    text-align: center !important;
}

.tt-cal-weekday {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    padding: 4px 0 !important;
    text-align: center !important;
}

/* Dates Grid */
.tt-cal-days-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    row-gap: 2px !important;
}

/* Date Cell Button */
.tt-cal-day {
    position: relative !important;
    border: none !important;
    background: transparent !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    cursor: pointer !important;
    transition: background 0.1s !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.tt-cal-day:hover:not(.is-disabled):not(.is-start):not(.is-end) {
    background: #e2e8f0;
    border-radius: 8px;
}

/* Today highlight */
.tt-cal-day.is-today:not(.is-start):not(.is-end) {
    color: #006ce4;
    font-weight: 800;
}

.tt-cal-day.is-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #006ce4;
}

.tt-cal-day.is-start::after,
.tt-cal-day.is-end::after {
    display: none;
}

/* Disabled past dates */
.tt-cal-day.is-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    pointer-events: none;
}

/* Selected Start Date */
.tt-cal-day.is-start {
    background: #006ce4 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 8px 0 0 8px !important;
    z-index: 2;
}

/* Selected End Date */
.tt-cal-day.is-end {
    background: #006ce4 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 0 8px 8px 0 !important;
    z-index: 2;
}

/* Both start & end same date or single start picked */
.tt-cal-day.is-start.is-single,
.tt-cal-day.is-start.is-end {
    border-radius: 8px !important;
}

/* In Range Background */
.tt-cal-day.in-range,
.tt-cal-day.is-hover-range {
    background: #f2f6fa !important;
    color: #0f172a !important;
    border-radius: 0 !important;
}

/* Empty day placeholder */
.tt-cal-day.is-empty {
    pointer-events: none;
    cursor: default;
}

/* Flexible Date Options Section */
.tt-cal-flexible-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.tt-cal-flexible-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.tt-cal-flex-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tt-cal-flex-pill {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.tt-cal-flex-pill:hover {
    border-color: #006ce4;
    color: #006ce4;
}

.tt-cal-flex-pill.active {
    border-color: #006ce4;
    background: #f0f7ff;
    color: #006ce4;
    box-shadow: 0 0 0 1px #006ce4;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .tt-calendar-popover {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 28px 28px 0 0 !important;
        padding: 20px 18px 26px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35) !important;
        z-index: 9999999 !important;
        animation: ttCalendarSlideUpMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    @keyframes ttCalendarSlideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .tt-cal-months {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .tt-cal-month-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 14px !important;
        padding: 0 4px !important;
    }

    .tt-cal-month-title {
        font-size: 16px !important;
        font-weight: 800 !important;
        color: #0f172a !important;
    }

    .tt-cal-nav-btn {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        background: #f1f5f9 !important;
        border: 1px solid #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        color: #334155 !important;
        cursor: pointer !important;
    }

    .tt-cal-nav-btn:hover {
        background: #e2e8f0 !important;
    }

    .tt-cal-weekdays {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 4px !important;
        margin-bottom: 8px !important;
        text-align: center !important;
    }

    .tt-cal-weekday {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #64748b !important;
        padding: 4px 0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .tt-cal-days-grid {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 4px !important;
        row-gap: 6px !important;
    }

    .tt-cal-day {
        min-height: 42px !important;
        height: 44px !important;
        aspect-ratio: 1 !important;
        font-size: 14.5px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.15s ease !important;
    }

    .tt-cal-day:hover:not(.is-disabled):not(.is-start):not(.is-end) {
        background: #f1f5f9 !important;
        border-radius: 12px !important;
    }

    .tt-cal-day.in-range {
        background: #e0f2fe !important;
        color: #0284c7 !important;
        border-radius: 6px !important;
    }

    .tt-cal-day.is-start {
        background: #006ce4 !important;
        color: #ffffff !important;
        border-radius: 12px !important;
        font-weight: 800 !important;
        box-shadow: 0 4px 10px rgba(0, 108, 228, 0.3) !important;
    }

    .tt-cal-day.is-end {
        background: #006ce4 !important;
        color: #ffffff !important;
        border-radius: 12px !important;
        font-weight: 800 !important;
        box-shadow: 0 4px 10px rgba(0, 108, 228, 0.3) !important;
    }

    .tt-cal-day.is-today:not(.is-start):not(.is-end) {
        color: #006ce4 !important;
        font-weight: 800 !important;
        border: 1.5px solid #006ce4 !important;
    }

    .tt-cal-backdrop {
        position: fixed !important;
        inset: 0 !important;
        background: rgba(15, 23, 42, 0.65) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 9999998 !important;
        animation: ttCalFadeIn 0.2s ease-out !important;
    }

    @keyframes ttCalFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

