/**
 * Airbnb-style Booking Widget CSS
 */

/* Widget Container */
.airbnb-booking-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    padding: 24px;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Title - No dates state */
.abw-no-dates .abw-title {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 24px 0;
    color: #222;
}

/* Price Display - With dates state */
.abw-with-dates {
    margin-bottom: 24px;
}

.abw-price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.abw-price-original {
    font-size: 16px;
    color: #717171;
    text-decoration: line-through;
}

.abw-price-current {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    text-decoration: underline;
}

.abw-price-nights {
    font-size: 16px;
    color: #222;
    font-weight: 400;
}

/* Form */
.abw-form {
    border: 1px solid #b0b0b0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

/* Dates Row */
.abw-dates-row {
    display: flex;
    border-bottom: 1px solid #b0b0b0;
}

.abw-date-field {
    flex: 1;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.abw-date-field:first-child {
    border-right: 1px solid #b0b0b0;
}

.abw-date-field:hover {
    background: #f7f7f7;
}

.abw-date-field.active {
    background: #fff;
    box-shadow: inset 0 0 0 2px #222;
    border-radius: 8px;
    z-index: 1;
}

.abw-date-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #222;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.abw-date-field .abw-date-value {
    display: block;
    font-size: 14px;
    color: #717171;
}

.abw-date-field.has-value .abw-date-value {
    color: #222;
}

/* Guests Row */
.abw-guests-row {
    position: relative;
}

.abw-guests-field {
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.abw-guests-field:hover {
    background: #f7f7f7;
}

.abw-guests-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #222;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.abw-guests-value {
    font-size: 14px;
    color: #222;
}

.abw-chevron {
    width: 16px;
    height: 16px;
    color: #222;
    transition: transform 0.2s;
}

.abw-guests-row.open .abw-chevron {
    transform: rotate(180deg);
}

/* Guests Row - Temporairement caché */
.abw-guests-row {
    display: none !important;
}

/* Phrase de réassurance - cachée */
.abw-reassurance {
    display: none !important;
}

/* Guests Dropdown */
.abw-guests-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

/* Liste des voyageurs */
.abw-guests-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.abw-guest-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #222;
}

.abw-guest-option:hover {
    background: #f7f7f7;
}

.abw-guest-option.selected {
    background: #f0f0f0;
    font-weight: 600;
}

/* Submit Button */
.abw-submit-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(to right, #e61e4d, #e31c5f, #d70466);
    color: #fff;
}

.abw-submit-btn:hover {
    background: linear-gradient(to right, #d11041, #cc1a52, #c2035b);
}

.abw-submit-btn.abw-reserve {
    background: linear-gradient(to right, #e61e4d, #e31c5f, #d70466);
}

/* Reassurance */
.abw-reassurance {
    text-align: center;
    font-size: 14px;
    color: #717171;
    margin: 16px 0 0 0;
}

/* Calendar Popup */
.abw-calendar-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.abw-calendar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
}

.abw-calendar-modal {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    max-width: 850px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    animation: abwSlideIn 0.2s ease-out;
}

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

/* Calendar Header */
.abw-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #ebebeb;
}

.abw-calendar-summary {
    flex: 1;
}

.abw-nights-count {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.abw-dates-range {
    font-size: 14px;
    color: #717171;
}

.abw-calendar-inputs {
    display: flex;
    gap: 0;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
}

.abw-input-field {
    padding: 8px 12px;
    min-width: 140px;
    position: relative;
}

.abw-input-field:first-child {
    border-right: 1px solid #b0b0b0;
}

.abw-input-field.active {
    background: #f7f7f7;
}

.abw-input-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #222;
    margin-bottom: 2px;
}

.abw-input-field .abw-input-value {
    font-size: 14px;
    color: #222;
}

.abw-clear-date {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.abw-input-field:hover .abw-clear-date {
    opacity: 1;
}

/* Calendar Body */
.abw-calendar-body {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 16px;
}

.abw-calendar-nav {
    padding-top: 40px;
}

.abw-calendar-nav button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.abw-calendar-nav button:hover {
    background: #f7f7f7;
}

.abw-calendar-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Calendar Month */
.abw-calendar-month {
    flex: 1;
    min-width: 280px;
}

.abw-month-header {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 16px;
    padding: 8px 0;
}

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

.abw-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #717171;
    padding: 8px 0;
}

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

.abw-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s;
    position: relative;
}

.abw-day:hover:not(.disabled):not(.selected) {
    border: 1px solid #222;
}

.abw-day.disabled {
    color: #b0b0b0;
    cursor: not-allowed;
    text-decoration: line-through;
}

.abw-day.today {
    font-weight: 700;
}

.abw-day.selected {
    background: #222;
    color: #fff;
}

.abw-day.in-range {
    background: #f7f7f7;
    border-radius: 0;
}

.abw-day.range-start {
    border-radius: 50% 0 0 50%;
    background: #f7f7f7;
}

.abw-day.range-start::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #222;
    border-radius: 50%;
    z-index: -1;
}

.abw-day.range-start {
    color: #fff;
    background: #222;
    border-radius: 50%;
}

.abw-day.range-end {
    border-radius: 0 50% 50% 0;
    background: #f7f7f7;
}

.abw-day.range-end {
    color: #fff;
    background: #222;
    border-radius: 50%;
}

.abw-day.other-month {
    visibility: hidden;
}

/* Calendar Footer */
.abw-calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #ebebeb;
}

.abw-keyboard-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.abw-keyboard-btn:hover {
    background: #f7f7f7;
}

.abw-footer-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.abw-clear-all {
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    padding: 8px 12px;
    text-decoration: underline;
}

.abw-clear-all:hover {
    color: #000;
}

.abw-close-calendar {
    background: #222;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.abw-close-calendar:hover {
    background: #000;
}

/* Responsive */
@media (max-width: 768px) {
    .abw-calendar-popup {
        padding-top: 0;
        align-items: flex-end;
    }
    
    .abw-calendar-modal {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    .abw-calendar-body {
        flex-direction: column;
        overflow-y: auto;
        max-height: 50vh;
    }
    
    .abw-calendar-nav {
        display: none;
    }
    
    .abw-calendar-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .abw-calendar-inputs {
        width: 100%;
    }
    
    .abw-input-field {
        flex: 1;
    }
}

/* Loading state */
.airbnb-booking-widget.loading .abw-submit-btn {
    opacity: 0.7;
    pointer-events: none;
}

.airbnb-booking-widget.loading .abw-submit-btn::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: abwSpin 0.8s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes abwSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Calendar Hint */
.abw-calendar-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #717171;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 8px;
}

.abw-calendar-hint svg {
    flex-shrink: 0;
    color: #717171;
}

/* Hide hint when dates are selected */
.airbnb-booking-widget .abw-with-dates + .abw-form + .abw-submit-btn + .abw-reassurance + .abw-calendar-hint {
    display: none;
}

/* JetBooking Calendar Highlight */
.jet-booking-calendar.abw-highlight,
.date-picker-wrapper.abw-highlight {
    animation: abwPulse 0.5s ease-in-out 3;
    box-shadow: 0 0 0 4px rgba(230, 30, 77, 0.3);
    border-radius: 8px;
}

@keyframes abwPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(230, 30, 77, 0.3);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(230, 30, 77, 0.1);
    }
}
