/**
 * Mobile styles for daterangepicker
 */

/* Modal container */
#mobile-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    display: none;
    overflow-y: auto;
}

#mobile-modal-container.active {
    display: block;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Modal base styles */
.mobile-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

/* Modal header */
.modal-header {
    display: flex;
    align-items: center;
    padding: 20px 20px 40px 20px;
    border-bottom: 1px solid #e5e5e5;
    z-index: 2; /* Ensure header is above other content */
}

.modal-title {
    flex: 1;
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin: 0;
}

.modal-back-btn,
.modal-close-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
    z-index: 3; /* Ensure buttons are clickable */
}

.modal-header-spacer {
    width: 40px; /* Same width as the close button */
}

/* Location picker styles */
.location-list {
    padding: 0;
    margin: 0;
}

.location-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    font-size: 18px;
}

.location-item:active {
    background-color: #f9f9f9;
}

/* Modal tabs */
.modal-tabs {
    display: flex;
    justify-content: center;
    padding: 16px;
    gap: 8px;
    z-index: 2; /* Ensure tabs are above other content */
    position: relative;
    background-color: #fff;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid #e5e5e5;
    background: none;
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    background-color: #333;
    color: white;
    border-color: #333;
}

/* Modal body */
.modal-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    position: relative; /* Important for positioning */
    z-index: 1; /* Ensure proper stacking */
}

/* DateRangePicker container in modal */
#daterangepicker-container {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    position: relative; /* Important for positioning */
    z-index: 1; /* Ensure proper stacking */
}

.modal-promocode {
    margin-bottom: 30px;
    padding: 0 20px;
}

.modal-promocode .field-value {
    width: 100%;
    height: 50px;
    padding-left: 30px;
    border-radius: 40px;
    color: black;
    border: 1px solid #FF7423;
}

.modal-promocode .field-value::placeholder {
    text-align: center;
    color: #FF7423;
}

/* Modal footer */
.modal-footer {
    padding: 16px;
    border-top: 1px solid #e5e5e5;
    position: relative;
    z-index: 2; /* Ensure footer is above other content */
    background-color: #fff;
    box-shadow: 2px 2px 21px 0px rgba(0, 0, 0, 0.10);
}

.modal-confirm-btn {
    width: 100%;
    padding: 16px;
    background-color: #E4DFD7;
    color: black;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 40px;
}

/* Guest modal styles */
.guest-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.guest-type-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 500;
}

.age-description {
    margin: 0;
    color: black;
    font-size: 14px;
}

.guest-counter {
    display: flex;
    align-items: center;
}

.counter-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: black;
}

.counter-value {
    margin: 0 12px;
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    color: black;
}

/* Child age inputs */
.child-age-input {
    margin-bottom: 16px;
}

.select-wrapper {
    position: relative;
}

.child-age-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    appearance: none;
    font-size: 16px;
    color: black;
}

.child-age-select option {
    color: black;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
    pointer-events: none;
}

/* Mobile DateRangePicker Styles */
.daterangepicker.mobile-daterangepicker {
    position: fixed !important;
    top: 100px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 80px !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: scroll;
}

/* Show single calendar at a time on mobile */
.daterangepicker.mobile-daterangepicker .drp-calendar.left {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

/* DateRangePicker calendar styling */
.daterangepicker.mobile-daterangepicker .calendar-table {
    width: 100% !important;
}

.daterangepicker.mobile-daterangepicker .calendar-table th,
.daterangepicker.mobile-daterangepicker .calendar-table td {
    width: 13.5vw !important; /* 1/7 of calendar width */
    height: 13.5vw !important; /* Match height to width as percentage of viewport width */
    max-height: 50px !important; /* Cap the maximum height */
    min-height: 35px !important; /* Ensure minimum height */
    text-align: center !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    padding: 0 !important;
    border: none !important;
    min-width: unset;
}

/* Day styling */
.daterangepicker.mobile-daterangepicker td.available {
    border-radius: 50% !important;
}

.daterangepicker.mobile-daterangepicker td.active,
.daterangepicker.mobile-daterangepicker td.active:hover {
    background-color: #BF9266 !important;
    border-color: #BF9266 !important;
    color: #fff !important;
}

.daterangepicker.mobile-daterangepicker td.start-date {
    border-radius: 50% 0 0 50% !important;
}

.daterangepicker.mobile-daterangepicker td.active.end-date.in-range.available {
    background-color: #BF9266 !important;
    color: white !important;
}

.daterangepicker.mobile-daterangepicker td.in-range {
    background-color: rgba(191, 146, 102, 0.35) !important;
    color: #333 !important;
    border-radius: 0 !important;
}

.daterangepicker.mobile-daterangepicker td.end-date {
    border-radius: 0 50% 50% 0 !important;
}

.daterangepicker.mobile-daterangepicker td.start-date.end-date {
    border-radius: 50% !important;
}

/* Month header styling */
.daterangepicker.mobile-daterangepicker .month {
    font-size: 16px !important;
    font-weight: 500 !important;
}

/* Month view styling */
.daterangepicker.mobile-daterangepicker.show-month-view .monthselect,
.daterangepicker.mobile-daterangepicker.show-month-view .yearselect {
    display: block !important;
    width: 100% !important;
    height: 40px !important;
    font-size: 16px !important;
    padding: 5px !important;
    margin: 5px 0 !important;
    border: 1px solid #eee !important;
    border-radius: 4px !important;
}

/* Next/Prev buttons */
.daterangepicker.mobile-daterangepicker .prev,
.daterangepicker.mobile-daterangepicker .next {
    font-size: 24px !important;
    line-height: 24px !important;
    padding: 10px !important;
    cursor: pointer !important;
}

/* Hide elements we don't need on mobile */
.daterangepicker.mobile-daterangepicker .ranges,
.daterangepicker.mobile-daterangepicker .drp-buttons {
    display: none !important;
}

/* Ensure the calendar container takes full width */
.daterangepicker.mobile-daterangepicker .drp-calendar,
.daterangepicker.mobile-daterangepicker .drp-calendar.left,
.daterangepicker.mobile-daterangepicker .drp-calendar.right {
    max-width: 100% !important;
    width: 100% !important;
    padding: 10px !important;
}

/* Display both calendars by default, stacked vertically */
.daterangepicker.mobile-daterangepicker .drp-calendars {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
}

/* Show More Months button */
.more-months-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin: 15px 0;
    cursor: pointer;
}

.more-months-btn:hover {
    background-color: #e8e8e8;
}

/* Extra months container */
.extra-months-container {
    display: none;
}

.extra-months-container.show {
    display: block;
}

.child-age-select.input-error {
  border: 1px solid red;
  background-color: #ffe5e5;
}

/* Mobile-specific overrides for the main widget */
@media (max-width: 767px) {
    /* Hide the expandable dropdowns on mobile */
    .field-expand {
        display: none !important;
    }

    /* Make entire field clickable */
    .reservation-widget .field {
        cursor: pointer;
    }
    
    /* Style adjustments for better mobile UX */
    .field-value {
        font-size: 16px;
    }
    
    /* Hide the original instance of daterangepicker when it opens automatically */
    body:not(.modal-open) .daterangepicker {
        display: none !important;
    }
}

/* Search bar styling */
.homepage-search-bar,
.mobile-search-bar {
    display: flex;
    align-items: center;
    margin: 16px;
    padding: 12px 16px;
    background-color: #fff;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.search-icon {
    margin-right: 8px;
}

.search-placeholder {
    color: #6B7280;
    font-size: 15px;
}

/* Loading indicator */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.modal-loading::after {
    content: "";
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.entry-date-list, .persons-list {
    padding: 0;
    margin: 0;
}
.entry-date-item, .persons-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    font-size: 18px;
    text-align: start;
}
.entry-date-item:active, .persons-item:active {
    background-color: #f9f9f9;
}
.duration-form label {
    display: block;
    padding: 16px 0;
    font-size: 18px;
    cursor: pointer;
}
.duration-form input[type="radio"] {
    margin-right: 8px;
}

.duration-list {
    padding: 0;
    margin: 0;
}
.duration-item {
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    font-size: 18px;
    text-align: start;
}
.duration-item:active {
    background-color: #f9f9f9;
}
