/**
 * Airbnb-Style Date Range Picker
 * Brand Colors: #2077ba, #ffbe5f, #f9b33b, #2c91ce
 * Desktop only - Mobile remains unchanged
 */

/* ============================================
   CALENDAR OVERLAY CONTAINER
   ============================================ */
.airbnb-calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.airbnb-calendar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MAIN CALENDAR CONTAINER
   ============================================ */
.airbnb-calendar {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
}

.airbnb-calendar.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   CALENDAR HEADER
   ============================================ */
.airbnb-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #ebebeb;
}

.airbnb-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.airbnb-nights-count {
    font-size: 22px;
    font-weight: 600;
    color: #222222;
    line-height: 1.2;
}

.airbnb-date-range-text {
    font-size: 14px;
    color: #717171;
    font-weight: 400;
}

/* Date Input Fields */
.airbnb-header-right {
    display: flex;
    gap: 0;
}

.airbnb-date-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.airbnb-date-input-wrapper:first-child .airbnb-date-input {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.airbnb-date-input-wrapper:last-child .airbnb-date-input {
    border-radius: 0 8px 8px 0;
}

.airbnb-date-input {
    width: 140px;
    padding: 20px 36px 8px 12px;
    border: 1px solid #b0b0b0;
    font-size: 14px;
    font-weight: 400;
    color: #222222;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.airbnb-date-input:focus,
.airbnb-date-input.active {
    border-color: #222222;
    border-width: 2px;
    outline: none;
}

.airbnb-date-input-label {
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #717171;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.airbnb-date-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    background: #717171;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.airbnb-date-input-wrapper:hover .airbnb-date-clear,
.airbnb-date-input-wrapper .airbnb-date-clear.show {
    opacity: 1;
}

.airbnb-date-clear:hover {
    background: #222222;
}

/* ============================================
   DUAL MONTH CALENDAR VIEW
   ============================================ */
.airbnb-calendar-body {
    display: flex;
    padding: 16px 24px 8px 24px;
    position: relative;
}

/* Month Navigation Arrows */
.airbnb-month-nav {
    position: absolute;
    top: 24px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    z-index: 10;
}

.airbnb-month-nav:hover {
    background: #f7f7f7;
}

.airbnb-month-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.airbnb-month-nav:disabled:hover {
    background: transparent;
}

.airbnb-month-nav svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #222222;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.airbnb-month-nav.prev {
    left: 24px;
}

.airbnb-month-nav.next {
    right: 24px;
}

/* Month Grid */
.airbnb-month {
    flex: 1;
    padding: 0 16px;
}

.airbnb-month:first-child {
    padding-left: 0;
}

.airbnb-month:last-child {
    padding-right: 0;
}

.airbnb-month-header {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    margin-bottom: 16px;
    padding-top: 4px;
}

/* Weekday Headers */
.airbnb-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.airbnb-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #717171;
    padding: 8px 0;
}

/* Days Grid */
.airbnb-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

/* Individual Day Cell */
.airbnb-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: #222222;
    transition: none;
    user-select: none;
}

.airbnb-day-inner {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.1s ease, color 0.1s ease;
    position: relative;
    z-index: 2;
}

.airbnb-day:hover .airbnb-day-inner {
    background: #f7f7f7;
}

/* Day States */
.airbnb-day.empty {
    cursor: default;
}

.airbnb-day.empty:hover .airbnb-day-inner {
    background: transparent;
}

.airbnb-day.disabled {
    color: #b0b0b0;
    cursor: not-allowed;
    text-decoration: line-through;
}

.airbnb-day.disabled:hover .airbnb-day-inner {
    background: transparent;
}

.airbnb-day.past {
    color: #b0b0b0;
    cursor: not-allowed;
}

.airbnb-day.past:hover .airbnb-day-inner {
    background: transparent;
}

/* Selected Start/End Dates - Using Brand Color */
.airbnb-day.selected-start .airbnb-day-inner,
.airbnb-day.selected-end .airbnb-day-inner {
    background: #222222;
    color: #ffffff;
    font-weight: 600;
}

.airbnb-day.selected-start:hover .airbnb-day-inner,
.airbnb-day.selected-end:hover .airbnb-day-inner {
    background: #222222;
}

/* Range Background - Subtle highlight between dates */
.airbnb-day.in-range::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    transform: translateY(-50%);
    background: #f7f7f7;
    z-index: 1;
}

.airbnb-day.selected-start.in-range::before {
    left: 50%;
}

.airbnb-day.selected-end.in-range::before {
    right: 50%;
}

.airbnb-day.selected-start.selected-end::before {
    display: none;
}

/* Hover Range Preview */
.airbnb-day.hover-range::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    transform: translateY(-50%);
    background: #f7f7f7;
    z-index: 1;
}

.airbnb-day.hover-end .airbnb-day-inner {
    background: #f7f7f7;
    border: 2px solid #222222;
}

/* ============================================
   CALENDAR FOOTER
   ============================================ */
.airbnb-calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #ebebeb;
}

.airbnb-keyboard-icon {
    width: 24px;
    height: 24px;
    color: #717171;
}

.airbnb-footer-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.airbnb-clear-dates {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #222222;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 0;
}

.airbnb-clear-dates:hover {
    color: #000000;
}

.airbnb-close-btn {
    background: #222222;
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.airbnb-close-btn:hover {
    background: #000000;
}

/* ============================================
   BRAND COLOR VARIANT (Optional)
   Add class 'brand-colors' to .airbnb-calendar
   ============================================ */
.airbnb-calendar.brand-colors .airbnb-day.selected-start .airbnb-day-inner,
.airbnb-calendar.brand-colors .airbnb-day.selected-end .airbnb-day-inner {
    background: #2077ba;
}

.airbnb-calendar.brand-colors .airbnb-day.selected-start:hover .airbnb-day-inner,
.airbnb-calendar.brand-colors .airbnb-day.selected-end:hover .airbnb-day-inner {
    background: #2c91ce;
}

.airbnb-calendar.brand-colors .airbnb-day.in-range::before,
.airbnb-calendar.brand-colors .airbnb-day.hover-range::before {
    background: rgba(32, 119, 186, 0.1);
}

.airbnb-calendar.brand-colors .airbnb-day.hover-end .airbnb-day-inner {
    background: rgba(32, 119, 186, 0.1);
    border-color: #2077ba;
}

.airbnb-calendar.brand-colors .airbnb-close-btn {
    background: #2077ba;
}

.airbnb-calendar.brand-colors .airbnb-close-btn:hover {
    background: #2c91ce;
}

.airbnb-calendar.brand-colors .airbnb-date-input:focus,
.airbnb-calendar.brand-colors .airbnb-date-input.active {
    border-color: #2077ba;
}

/* ============================================
   TRIGGER INPUT STYLING
   ============================================ */
.airbnb-date-trigger {
    position: relative;
    cursor: pointer;
}

.airbnb-date-trigger input {
    cursor: pointer;
}

/* ============================================
   HIDE ON MOBILE (Keep existing mobile behavior)
   ============================================ */
@media (max-width: 768px) {
    .airbnb-calendar,
    .airbnb-calendar-overlay {
        display: none !important;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes airbnb-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.airbnb-day:focus .airbnb-day-inner {
    outline: 2px solid #2077ba;
    outline-offset: 2px;
}

.airbnb-month-nav:focus {
    outline: 2px solid #2077ba;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .airbnb-calendar,
    .airbnb-calendar-overlay,
    .airbnb-day-inner,
    .airbnb-month-nav {
        transition: none;
    }
}
