/**
 * Airbnb-Style DateRangePicker Stylesheet
 * Matches Airbnb's clean, modern design aesthetic
 *
 * @author Staylist Development Team
 * @version 1.0.0
 */

/* ============================================
   Main Container
   ============================================ */

.airbnb-datepicker {
    position: absolute;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 32px;
    min-width: 760px;
    color: #222222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Active state for trigger element */
.airbnb-datepicker-active {
    border-color: #FF385C !important;
    box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1) !important;
}

/* ============================================
   Header (Selected Display)
   ============================================ */

.airbnb-datepicker-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebebeb;
}

.airbnb-datepicker-selected {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    text-align: center;
}

/* ============================================
   Calendars Container
   ============================================ */

.airbnb-datepicker-calendars {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 20px;
}

.airbnb-datepicker-calendar {
    flex: 0 0 auto;
}

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

.airbnb-datepicker-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    height: 40px;
}

.airbnb-datepicker-month-name {
    font-size: 16px;
    font-weight: 700;
    color: #222222;
    flex: 1;
    text-align: center;
    letter-spacing: -0.2px;
}

.airbnb-datepicker-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #222222;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 14px;
}

.airbnb-datepicker-nav:hover {
    background: #f7f7f7;
    transform: scale(1.05);
}

.airbnb-datepicker-nav:active {
    transform: scale(0.95);
}

.airbnb-datepicker-nav-spacer {
    width: 32px;
    height: 32px;
    display: inline-block;
}

/* ============================================
   Weekday Headers
   ============================================ */

.airbnb-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
    margin-bottom: 8px;
}

.airbnb-datepicker-weekday {
    font-size: 12px;
    font-weight: 700;
    color: #717171;
    text-align: center;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.airbnb-datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
}

.airbnb-datepicker-day {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #222222;
    transition: all 0.15s ease;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Hover state */
.airbnb-datepicker-day:not(.outside):hover {
    background: #f7f7f7;
}

/* Today */
.airbnb-datepicker-day.today {
    font-weight: 700;
    position: relative;
}

.airbnb-datepicker-day.today::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #222222;
}

/* Selected dates (start/end) */
.airbnb-datepicker-day.selected {
    background: #FF385C;
    color: white;
    font-weight: 700;
    z-index: 2;
}

.airbnb-datepicker-day.selected:hover {
    background: #E31C5F;
}

.airbnb-datepicker-day.start-date {
    background: #FF385C;
    color: white;
    z-index: 2;
}

.airbnb-datepicker-day.end-date {
    background: #FF385C;
    color: white;
    z-index: 2;
}

/* In-range dates - full rectangular background */
.airbnb-datepicker-day.in-range {
    background: rgba(255, 56, 92, 0.1);
    color: #222222;
    border-radius: 0;
    position: relative;
}

.airbnb-datepicker-day.in-range:hover {
    background: rgba(255, 56, 92, 0.15);
}

/* Start date - fully circular with connecting background */
.airbnb-datepicker-day.start-date {
    background: #FF385C;
    color: white;
    z-index: 2;
    border-radius: 50%;
    position: relative;
}

.airbnb-datepicker-day.start-date.in-range::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 56, 92, 0.1);
    z-index: -1;
    border-radius: 0;
}

/* End date - fully circular with connecting background */
.airbnb-datepicker-day.end-date {
    background: #FF385C;
    color: white;
    z-index: 2;
    border-radius: 50%;
    position: relative;
}

.airbnb-datepicker-day.end-date.in-range::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 56, 92, 0.1);
    z-index: -1;
    border-radius: 0;
}

/* Hover preview when selecting end date */
.airbnb-datepicker-day.hover-in-range {
    background: transparent;
    border-radius: 0;
    position: relative;
}

.airbnb-datepicker-day.hover-in-range::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 56, 92, 0.08);
    z-index: -1;
}

.airbnb-datepicker-day.hover-end {
    background: rgba(255, 56, 92, 0.2);
    border-radius: 50%;
    font-weight: 600;
}

.airbnb-datepicker-day.hover-end::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(255, 56, 92, 0.08);
    z-index: -1;
}

/* Disabled dates */
.airbnb-datepicker-day.disabled {
    color: #dddddd;
    cursor: default;
    pointer-events: none;
}

/* Outside current month */
.airbnb-datepicker-day.outside {
    visibility: hidden;
    pointer-events: none;
}

.airbnb-datepicker-day.outside:hover {
    background: transparent;
    transform: none;
}

/* ============================================
   Footer (Buttons)
   ============================================ */

.airbnb-datepicker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #ebebeb;
    gap: 12px;
}

.airbnb-datepicker-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.airbnb-datepicker-btn:active {
    transform: scale(0.98);
}

.airbnb-datepicker-btn-clear {
    background: transparent;
    color: #222222;
    text-decoration: underline;
}

.airbnb-datepicker-btn-clear:hover {
    background: #f7f7f7;
}

.airbnb-datepicker-btn-apply {
    background: #FF385C;
    color: white;
    padding: 10px 24px;
    flex: 1;
    max-width: 200px;
    margin-left: auto;
}

.airbnb-datepicker-btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 56, 92, 0.4);
    background: #E31C5F;
}

.airbnb-datepicker-btn-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.airbnb-datepicker-btn-apply:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .airbnb-datepicker {
        min-width: unset;
        max-width: 95vw;
        padding: 16px;
        border-radius: 12px;
    }

    .airbnb-datepicker-calendars {
        flex-direction: column;
        gap: 24px;
    }

    .airbnb-datepicker-calendar {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .airbnb-datepicker-month-name {
        font-size: 14px;
    }

    .airbnb-datepicker-day {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .airbnb-datepicker-footer {
        flex-direction: column-reverse;
    }

    .airbnb-datepicker-btn-apply {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .airbnb-datepicker {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        min-width: unset !important;
        border-radius: 0;
        padding: 20px 16px;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        box-sizing: border-box;
    }

    .airbnb-datepicker-calendars {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
    }

    .airbnb-datepicker-calendar {
        width: 100%;
        max-width: 100%;
    }

    .airbnb-datepicker-days,
    .airbnb-datepicker-weekdays {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0;
        width: 100%;
    }

    .airbnb-datepicker-day {
        width: 100%;
        aspect-ratio: 1;
        font-size: 14px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
    }

    /* Fix in-range background for mobile - rectangular */
    .airbnb-datepicker-day.in-range {
        border-radius: 0 !important;
    }

    /* Ensure start and end dates maintain circular shape over in-range */
    .airbnb-datepicker-day.start-date,
    .airbnb-datepicker-day.end-date,
    .airbnb-datepicker-day.selected {
        border-radius: 50% !important;
    }

    .airbnb-datepicker-weekday {
        font-size: 11px;
        padding: 8px 0;
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.airbnb-datepicker {
    animation: fadeIn 0.2s ease;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .airbnb-datepicker {
        display: none !important;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.airbnb-datepicker-day:focus,
.airbnb-datepicker-nav:focus,
.airbnb-datepicker-btn:focus {
    outline: 2px solid #FF385C;
    outline-offset: 2px;
}

.airbnb-datepicker-day:focus:not(:focus-visible),
.airbnb-datepicker-nav:focus:not(:focus-visible),
.airbnb-datepicker-btn:focus:not(:focus-visible) {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .airbnb-datepicker {
        border: 2px solid currentColor;
    }

    .airbnb-datepicker-day.selected {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .airbnb-datepicker,
    .airbnb-datepicker-day,
    .airbnb-datepicker-nav,
    .airbnb-datepicker-btn {
        transition: none;
        animation: none;
    }

    .airbnb-datepicker-day:hover {
        transform: none;
    }
}
