/* ========================================
   LISTING DETAIL - BOOKING WIDGET
   Airbnb-style sticky booking sidebar
   ======================================== */

/* ========================================
   BOOKING WIDGET CONTAINER
   ======================================== */

.booking-widget {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    width: 100%;
}

.booking-widget-title {
    font-size: 22px;
    font-weight: 600;
    color: #222222;
    margin: 0 0 24px 0;
    line-height: 1.3;
}

.booking-widget-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 24px;
}

.booking-widget-price-amount {
    font-size: 22px;
    font-weight: 600;
    color: #222222;
}

.booking-widget-price-period {
    font-size: 16px;
    font-weight: 400;
    color: #222222;
}

/* ========================================
   DATE INPUTS
   ======================================== */

.booking-date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #b0b0b0;
    border-bottom: none; /* No bottom border - connects to guest selector below */
    border-radius: 8px 8px 0 0; /* Only round top corners */
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.booking-date-inputs:hover {
    border-color: #222222;
}

.booking-date-inputs:focus-within {
    border-color: #222222;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.booking-date-input {
    padding: 10px 12px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    position: relative;
}

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

.booking-date-input-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #222222;
    margin-bottom: 4px;
}

.booking-date-input-value {
    display: block;
    font-size: 14px;
    font-weight: 400;
    color: #717171;
}

.booking-date-input-value.has-date {
    color: #222222;
}

/* ========================================
   GUEST SELECTOR
   ======================================== */

.booking-guest-selector {
    border: 1px solid #b0b0b0;
    border-radius: 0 0 8px 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.booking-guest-selector:hover {
    border-color: #222222;
}

.booking-guest-selector-left {
    flex: 1;
}

.booking-guest-selector-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #222222;
    margin-bottom: 4px;
}

.booking-guest-selector-value {
    font-size: 14px;
    font-weight: 400;
    color: #222222;
}

.booking-guest-selector-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.booking-guest-selector-arrow.open {
    transform: rotate(180deg);
}

/* ========================================
   GUEST DROPDOWN
   ======================================== */

.guest-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    min-width: 320px;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.guest-dropdown.open {
    display: block;
    animation: guestDropdownSlideIn 0.2s ease-out;
}

/* ========================================
   GUEST SELECTOR OVERLAY
   ======================================== */

.guest-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: none;
    background: rgba(0, 0, 0, 0.25);
}

.guest-selector-overlay.open {
    display: block;
}

@keyframes guestDropdownSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.guest-dropdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #ebebeb;
}

.guest-dropdown-row:last-child {
    border-bottom: none;
}

.guest-dropdown-row-info {
    flex: 1;
}

.guest-dropdown-row-title {
    font-size: 16px;
    font-weight: 400;
    color: #222222;
    margin: 0 0 4px 0;
}

.guest-dropdown-row-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #717171;
    margin: 0;
}

.guest-dropdown-row-subtitle a {
    color: #222222;
    text-decoration: underline;
}

.guest-dropdown-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.guest-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #b0b0b0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #717171;
    font-size: 18px;
    line-height: 1;
}

.guest-control-btn:hover:not(:disabled) {
    border-color: #222222;
    color: #222222;
}

.guest-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.guest-control-count {
    font-size: 16px;
    font-weight: 400;
    color: #222222;
    min-width: 20px;
    text-align: center;
}

.guest-dropdown-close {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
}

.guest-dropdown-close-btn {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 0;
}

/* ========================================
   CHECK AVAILABILITY BUTTON
   ======================================== */

.check-availability-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 16px;
    background: linear-gradient(to right, #e61e4d 0%, #e31c5f 50%, #d70466 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.check-availability-btn:hover {
    background: linear-gradient(to right, #d11a45 0%, #cc1955 50%, #c4045c 100%);
    transform: scale(1.01);
}

.check-availability-btn:active {
    transform: scale(0.98);
}

/* Reserve button variant (when dates are selected) */
.reserve-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 16px;
    background: linear-gradient(to right, #e61e4d 0%, #e31c5f 50%, #d70466 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reserve-btn:hover {
    background: linear-gradient(to right, #d11a45 0%, #cc1955 50%, #c4045c 100%);
}

/* ========================================
   PRICE BREAKDOWN (shown after dates selected)
   ======================================== */

.price-breakdown {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #dddddd;
    display: none;
}

.price-breakdown.visible {
    display: block;
}

.price-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.price-breakdown-row:last-child {
    margin-bottom: 0;
}

.price-breakdown-label {
    font-size: 16px;
    font-weight: 400;
    color: #222222;
    text-decoration: underline;
    cursor: pointer;
}

.price-breakdown-value {
    font-size: 16px;
    font-weight: 400;
    color: #222222;
}

.price-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #dddddd;
}

.price-breakdown-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
}

.price-breakdown-total-value {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
}

/* ========================================
   REPORT LISTING LINK
   ======================================== */

.report-listing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
}

.report-listing-link {
    font-size: 14px;
    font-weight: 400;
    color: #717171;
    text-decoration: underline;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-listing-link:hover {
    color: #222222;
}

.report-listing-icon {
    width: 16px;
    height: 16px;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 1024px) {
    .booking-widget {
        max-width: 100%;
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .booking-widget {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px;
        box-shadow: none;
        border-top: 1px solid #dddddd;
    }

    .booking-widget-title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .check-availability-btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    /* Full-screen guest dropdown on mobile */
    .guest-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        border-radius: 0;
        min-width: auto;
        max-width: none;
        padding: 16px;
        animation: none;
    }

    .guest-dropdown.open {
        animation: guestDropdownMobileSlideIn 0.3s ease-out;
    }

    @keyframes guestDropdownMobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   BOOKING WIDGET WRAPPER (for positioning)
   ======================================== */

.booking-widget-wrapper {
    position: relative;
}

/* Ensures dropdown appears correctly */
.booking-form-container {
    position: relative;
}

/* ========================================
   MOBILE FIXED BOTTOM BOOKING BAR
   ======================================== */

.mobile-booking-bar {
    display: none;
}

@media (max-width: 768px) {
    /* Hide the booking column on mobile - use bottom bar instead */
    .listing-booking-column {
        display: none !important;
    }

    /* Fixed bottom booking bar */
    .mobile-booking-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #dddddd;
        padding: 16px 24px;
        z-index: 100;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-booking-bar-info {
        flex: 1;
    }

    .mobile-booking-bar-price {
        display: flex;
        align-items: baseline;
        gap: 4px;
    }

    .mobile-booking-bar-amount {
        font-size: 18px;
        font-weight: 600;
        color: #222222;
    }

    .mobile-booking-bar-period {
        font-size: 14px;
        font-weight: 400;
        color: #222222;
    }

    .mobile-booking-bar-dates {
        font-size: 14px;
        font-weight: 400;
        color: #717171;
        text-decoration: underline;
        cursor: pointer;
        margin-top: 4px;
    }

    .mobile-booking-bar-btn {
        padding: 14px 24px;
        background: linear-gradient(to right, #e61e4d 0%, #e31c5f 50%, #d70466 100%);
        color: #ffffff;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .mobile-booking-bar-btn:hover {
        background: linear-gradient(to right, #d11a45 0%, #cc1955 50%, #c4045c 100%);
    }

    /* Add padding to content so it's not hidden behind the fixed bar */
    .listing-view-wrapper.modern-layout {
        padding-bottom: 140px;
    }

    /* Editor tab content - add bottom padding for mobile booking bar */
    #editor-content.listing-tab-content {
        padding-bottom: 200px;
    }

    /* Teams tab content - add bottom padding for mobile booking bar */
    #teams-content.listing-tab-content {
        padding-bottom: 200px;
    }
}
