/* =========================================================
   Ubud Vacation
   Global Booking Calendar
   ========================================================= */


/* =========================================================
   Modal
   ========================================================= */

.calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.55);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


.calendar-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   Dialog
   ========================================================= */

.calendar-modal__dialog {
    position: relative;

    width: 100%;
    max-width: 430px;

    max-height: calc(100vh - 40px);

    display: flex;
    flex-direction: column;

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2);

    transform: translateY(15px) scale(0.98);

    transition:
        transform 0.2s ease;
}


.calendar-modal.is-open
.calendar-modal__dialog {
    transform: translateY(0) scale(1);
}


/* =========================================================
   Header
   ========================================================= */

.calendar-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 22px 22px 16px;

    border-bottom: 1px solid #eeeeee;
}


.calendar-modal__header-content {
    min-width: 0;
}


.calendar-modal__title {
    margin: 0;

    font-size: 22px;
    line-height: 1.25;

    font-weight: 700;

    color: #222222;
}


.calendar-modal__subtitle {
    margin: 5px 0 0;

    font-size: 14px;
    line-height: 1.5;

    color: #777777;
}


/* =========================================================
   Close Button
   ========================================================= */

.calendar-modal__close {
    flex: 0 0 auto;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #f5f5f5;

    color: #333333;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.calendar-modal__close:hover {
    background: #eeeeee;
}


/* =========================================================
   Calendar Wrapper
   ========================================================= */

.calendar {
    position: relative;

    padding: 20px 22px;

    overflow-y: auto;
}


/* =========================================================
   Loading
   ========================================================= */

.calendar__loading {
    position: absolute;
    inset: 0;

    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(255, 255, 255, 0.8);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}


.calendar.is-loading
.calendar__loading {
    opacity: 1;
    visibility: visible;
}


.calendar__loading-text {
    font-size: 14px;
    color: #555555;
}


/* =========================================================
   Calendar Navigation
   ========================================================= */

.calendar__navigation {
    display: grid;

    grid-template-columns: 40px 1fr 40px;

    align-items: center;

    gap: 10px;

    margin-bottom: 18px;
}


.calendar__month {
    margin: 0;

    text-align: center;

    font-size: 17px;
    line-height: 1.4;

    font-weight: 700;

    color: #222222;
}


.calendar__navigation-button {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid #e5e5e5;
    border-radius: 10px;

    background: #ffffff;

    color: #333333;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.calendar__navigation-button:hover:not(:disabled) {
    background: #f7f7f7;
}


.calendar__navigation-button:disabled {
    opacity: 0.35;

    cursor: not-allowed;
}


/* =========================================================
   Weekdays
   ========================================================= */

.calendar__weekdays {
    display: grid;

    grid-template-columns:
        repeat(7, minmax(0, 1fr));

    gap: 5px;

    margin-bottom: 6px;
}


.calendar__weekday {
    min-width: 0;

    padding: 6px 0;

    text-align: center;

    font-size: 11px;
    line-height: 1.3;

    font-weight: 600;

    color: #888888;

    text-transform: uppercase;
}


/* =========================================================
   Days
   ========================================================= */

.calendar__days {
    display: grid;

    grid-template-columns:
        repeat(7, minmax(0, 1fr));

    gap: 5px;
}


.calendar__day {
    width: 100%;
    aspect-ratio: 1 / 1;

    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid transparent;
    border-radius: 10px;

    background: #ffffff;

    color: #333333;

    font-size: 14px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


.calendar__day:hover:not(:disabled) {
    background: #f3f3f3;

    border-color: #dddddd;
}


/* Empty day */

.calendar__day--empty {
    pointer-events: none;

    background: transparent;

    border-color: transparent;
}


/* Today */

.calendar__day--today {
    border-color: #222222;

    font-weight: 700;
}


/* Selected */

.calendar__day--selected {
    background: #222222;

    border-color: #222222;

    color: #ffffff;

    font-weight: 700;
}


/* Past */

.calendar__day--past {
    color: #cccccc;

    background: #fafafa;

    cursor: not-allowed;
}


/* Blocked */

.calendar__day--blocked {
    position: relative;

    color: #bbbbbb;

    background: #f5f5f5;

    text-decoration: line-through;

    cursor: not-allowed;
}


.calendar__day--blocked::after {
    content: "";

    position: absolute;

    width: 5px;
    height: 5px;

    bottom: 7px;

    border-radius: 50%;

    background: #bbbbbb;
}


/* =========================================================
   Selected Date
   ========================================================= */

.calendar__selected {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-top: 20px;
    padding: 14px 15px;

    border-radius: 12px;

    background: #f7f7f7;
}


.calendar__selected-label {
    font-size: 12px;

    color: #777777;
}


.calendar__selected-date {
    text-align: right;

    font-size: 13px;

    font-weight: 600;

    color: #222222;
}


/* =========================================================
   Error
   ========================================================= */

.calendar__error {
    display: none;

    margin-top: 12px;

    padding: 10px 12px;

    border-radius: 8px;

    background: #fff1f1;

    color: #c62828;

    font-size: 13px;
    line-height: 1.4;
}


.calendar__error.is-visible {
    display: block;
}

/* =========================================================
   Availability Message
   ========================================================= */

.calendar__availability {
    display: none;

    margin-top: 15px;
    padding: 12px 14px;

    border-radius: 10px;

    background: #f1f8f3;

    color: #287a45;

    font-size: 13px;
    line-height: 1.4;

    font-weight: 500;
}

.calendar__availability.is-visible {
    display: block;
}

/* =========================================================
   Footer
   ========================================================= */

.calendar-modal__footer {
    padding: 15px 22px 20px;

    border-top: 1px solid #eeeeee;

    background: #ffffff;
}


.calendar-modal__continue {
    width: 100%;

    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 18px;

    border: 0;
    border-radius: 10px;

    background: #222222;

    color: #ffffff;

    font-size: 14px;
    line-height: 1.3;

    font-weight: 600;

    cursor: pointer;

    transition:
        opacity 0.2s ease,
        background 0.2s ease;
}


.calendar-modal__continue:hover:not(:disabled) {
    background: #111111;
}


.calendar-modal__continue:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 575px) {

    .calendar-modal {
        align-items: flex-end;

        padding: 0;
    }


    .calendar-modal__dialog {
        max-width: none;

        max-height: 92vh;

        border-radius:
            18px 18px 0 0;

        transform:
            translateY(100%);
    }


    .calendar-modal.is-open
    .calendar-modal__dialog {
        transform:
            translateY(0);
    }


    .calendar-modal__header {
        padding:
            18px 18px 14px;
    }


    .calendar-modal__title {
        font-size: 20px;
    }


    .calendar {
        padding:
            18px;
    }


    .calendar__navigation {
        margin-bottom: 14px;
    }


    .calendar__days {
        gap: 4px;
    }


    .calendar__day {
        border-radius: 8px;

        font-size: 13px;
    }


    .calendar__weekday {
        font-size: 10px;
    }


    .calendar__selected {
        margin-top: 15px;
    }


    .calendar-modal__footer {
        padding:
            12px 18px 18px;
    }

}

/* =========================================================
   Very Small Mobile
   ========================================================= */

@media (max-width: 360px) {

    .calendar__day {
        font-size: 12px;
    }


    .calendar__navigation-button {
        width: 36px;
        height: 36px;
    }


    .calendar__navigation {
        grid-template-columns:
            36px 1fr 36px;
    }

}