/**
 * AfroBookings - Search Form Styles
 * Custom conflict-free CSS using unique IDs
 * Works for: Hotel, Space, Car, Event, Tour, Boat, Visa
 * All selectors use IDs for maximum specificity
 */

/* ============================================
   RESET - Override any inherited styles from search-pages.css
   ============================================ */
#afro-hotel-search,
#afro-hotel-search *,
#afro-space-search,
#afro-space-search *,
#afro-car-search,
#afro-car-search *,
#afro-event-search,
#afro-event-search *,
#afro-tour-search,
#afro-tour-search *,
#afro-boat-search,
#afro-boat-search *,
#afro-visa-search,
#afro-visa-search *,
[id^="afro-"][id$="-search"],
[id^="afro-"][id$="-search"] * {
    box-sizing: border-box;
}

/* ============================================
   MAIN CONTAINER - All Modules
   ============================================ */
.bc_search_hotel .bc_form_search #afro-hotel-search,
.bc_search_space .bc_form_search #afro-space-search,
.bc_search_car .bc_form_search #afro-car-search,
.bc_search_event .bc_form_search #afro-event-search,
.bc_search_tour .bc_form_search #afro-tour-search,
.bc_search_boat .bc_form_search #afro-boat-search,
.bc_search_visa .bc_form_search #afro-visa-search,
#afro-hotel-search,
#afro-space-search,
#afro-car-search,
#afro-event-search,
#afro-tour-search,
#afro-boat-search,
#afro-visa-search,
[id^="afro-"][id$="-search"] {
    width: 100% !important;
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.bc_form_search #afro-search-form,
#afro-search-form {
    background: #ffffff !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12) !important;
    padding: 6px !important;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

/* ============================================
   SEARCH FIELDS CONTAINER - All Modules
   ============================================ */
.bc_form_search #afro-search-fields,
#afro-search-fields {
    display: flex !important;
    align-items: stretch !important;
    background: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 16px !important;
    overflow: visible !important;
    width: 100% !important;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

/* Ensure search form is always clickable on tour search page */
.bc_search_tour .bc_form_search,
.bc_search_tour .bc_form_search * {
    pointer-events: auto;
}

.bc_search_tour .bc_form_search {
    position: relative;
    z-index: 200;
}

/* Ensure inputs and button can receive clicks */
#afro-tour-search .smart-search-location,
#afro-tour-search #afro-search-btn {
    pointer-events: auto;
}

/* ============================================
   INDIVIDUAL FIELDS - All Modules
   ============================================ */
#afro-hotel-search .afro-field,
#afro-space-search .afro-field,
#afro-car-search .afro-field,
#afro-event-search .afro-field,
#afro-tour-search .afro-field,
#afro-boat-search .afro-field,
#afro-visa-search .afro-field,
[id^="afro-"][id$="-search"] .afro-field {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
    position: relative;
    flex: 1;
    min-width: 0;
    border-right: 1px solid #e9ecef;
    transition: background 0.2s ease;
    background: transparent;
    margin: 0;
}

#afro-hotel-search .afro-field:hover,
#afro-space-search .afro-field:hover,
#afro-car-search .afro-field:hover,
#afro-event-search .afro-field:hover,
#afro-tour-search .afro-field:hover,
#afro-boat-search .afro-field:hover,
#afro-visa-search .afro-field:hover,
[id^="afro-"][id$="-search"] .afro-field:hover {
    background: rgba(232, 93, 4, 0.02);
}

/* Field sizing - distribute space evenly */
#afro-field-location {
    flex: 1.5 1 0;
    min-width: 200px;
}

#afro-field-date {
    flex: 1.8 1 0;
    min-width: 220px;
}

#afro-field-guests {
    flex: 1.5 1 0;
    min-width: 180px;
}

#afro-field-submit {
    flex: 0 0 auto;
    padding: 12px 12px 12px 20px;
    background: transparent !important;
    border-right: none;
    margin-left: auto;
}

#afro-field-submit:hover {
    background: transparent !important;
}

/* ============================================
   FIELD ICON - All Modules
   ============================================ */
#afro-hotel-search .afro-field-icon,
#afro-space-search .afro-field-icon,
#afro-car-search .afro-field-icon,
#afro-event-search .afro-field-icon,
#afro-tour-search .afro-field-icon,
[id^="afro-"][id$="-search"] .afro-field-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.12), rgba(232, 93, 4, 0.05));
    border-radius: 12px;
    flex-shrink: 0;
}

#afro-hotel-search .afro-field-icon i,
#afro-space-search .afro-field-icon i,
#afro-car-search .afro-field-icon i,
#afro-event-search .afro-field-icon i,
#afro-tour-search .afro-field-icon i,
[id^="afro-"][id$="-search"] .afro-field-icon i {
    font-size: 20px;
    color: #E85D04;
    line-height: 1;
}

/* ============================================
   FIELD CONTENT - All Modules
   ============================================ */
#afro-hotel-search .afro-field-content,
#afro-space-search .afro-field-content,
#afro-car-search .afro-field-content,
#afro-event-search .afro-field-content,
#afro-tour-search .afro-field-content,
[id^="afro-"][id$="-search"] .afro-field-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#afro-hotel-search .afro-field-label,
#afro-space-search .afro-field-label,
#afro-car-search .afro-field-label,
#afro-event-search .afro-field-label,
#afro-tour-search .afro-field-label,
[id^="afro-"][id$="-search"] .afro-field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

#afro-hotel-search .afro-field-input,
#afro-space-search .afro-field-input,
#afro-car-search .afro-field-input,
#afro-event-search .afro-field-input,
#afro-tour-search .afro-field-input,
[id^="afro-"][id$="-search"] .afro-field-input {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #2C3E50;
    line-height: 1.4;
    outline: none;
    cursor: pointer;
    box-shadow: none;
}

#afro-hotel-search .afro-field-input::placeholder,
#afro-space-search .afro-field-input::placeholder,
#afro-car-search .afro-field-input::placeholder,
#afro-event-search .afro-field-input::placeholder,
#afro-tour-search .afro-field-input::placeholder,
[id^="afro-"][id$="-search"] .afro-field-input::placeholder {
    color: #adb5bd;
}

#afro-hotel-search .afro-field-input:focus,
#afro-space-search .afro-field-input:focus,
#afro-car-search .afro-field-input:focus,
#afro-event-search .afro-field-input:focus,
#afro-tour-search .afro-field-input:focus,
[id^="afro-"][id$="-search"] .afro-field-input:focus {
    outline: none;
    box-shadow: none;
}

/* ============================================
   LOCATION FIELD - Smart Search
   ============================================ */
#afro-field-location .smart-search {
    position: relative;
    width: 100%;
}

#afro-field-location .smart-search .bc-autocomplete {
    position: absolute;
    top: calc(100% + 12px);
    left: -80px;
    right: -20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    padding: 8px;
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    pointer-events: auto;
}

#afro-field-location .smart-search .bc-autocomplete.show {
    display: block;
}

#afro-field-location .smart-search .bc-autocomplete .item {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

#afro-field-location .smart-search .bc-autocomplete .item:hover {
    background: rgba(232, 93, 4, 0.08);
    color: #E85D04;
}

#afro-field-location .smart-search .bc-autocomplete .message {
    padding: 12px 16px;
    font-size: 14px;
    color: #6c757d;
}

/* ============================================
   DATE FIELD
   ============================================ */
#afro-date-picker {
    position: relative;
    width: 100%;
}

#afro-date-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #2C3E50;
}

#afro-hotel-search .afro-date-sep,
#afro-space-search .afro-date-sep,
#afro-car-search .afro-date-sep,
#afro-event-search .afro-date-sep,
#afro-tour-search .afro-date-sep,
[id^="afro-"][id$="-search"] .afro-date-sep {
    color: #adb5bd;
    font-size: 14px;
}

#afro-date-picker .check-in-render,
#afro-date-picker .check-out-render {
    font-size: 15px;
    font-weight: 500;
    color: #2C3E50;
}

/* Hide the actual date input but keep it functional */
#afro-date-picker .check-in-out {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
    z-index: 5;
}

/* ============================================
   GUESTS FIELD
   ============================================ */
#afro-guests-toggle {
    cursor: pointer;
}

#afro-guests-toggle::after {
    display: none !important;
}

#afro-guests-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #2C3E50;
}

#afro-hotel-search .afro-guests-sep,
#afro-space-search .afro-guests-sep,
#afro-car-search .afro-guests-sep,
#afro-event-search .afro-guests-sep,
#afro-tour-search .afro-guests-sep,
[id^="afro-"][id$="-search"] .afro-guests-sep {
    color: #adb5bd;
}

/* Guests Dropdown */
#afro-guests-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    padding: 20px;
    z-index: 1050;
    min-width: 280px;
}

#afro-guests-dropdown .dropdown-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

#afro-guests-dropdown .dropdown-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

#afro-guests-dropdown .dropdown-item-row:first-child {
    padding-top: 0;
}

#afro-guests-dropdown .label {
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
}

#afro-guests-dropdown .val {
    display: flex;
    align-items: center;
    gap: 8px;
}

#afro-guests-dropdown .btn-minus,
#afro-guests-dropdown .btn-add {
    width: 36px;
    height: 36px;
    border: 2px solid #e9ecef;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    padding: 0;
}

#afro-guests-dropdown .btn-minus:hover,
#afro-guests-dropdown .btn-add:hover {
    border-color: #27AE60;
    color: #27AE60;
}

#afro-guests-dropdown .count-display input {
    width: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #2C3E50;
    -moz-appearance: textfield;
    padding: 0;
}

#afro-guests-dropdown .count-display input::-webkit-outer-spin-button,
#afro-guests-dropdown .count-display input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ============================================
   SEARCH BUTTON
   ============================================ */
#afro-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 160px;
    height: 56px;
    padding: 0 32px;
    background: linear-gradient(135deg, #27AE60, #1E8449);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

#afro-search-btn:hover {
    background: linear-gradient(135deg, #1E8449, #27AE60);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

#afro-search-btn i {
    font-size: 16px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    #afro-search-fields {
        flex-wrap: wrap;
    }

    #afro-hotel-search .afro-field,
    #afro-space-search .afro-field,
    #afro-car-search .afro-field,
    #afro-event-search .afro-field,
    #afro-tour-search .afro-field,
    [id^="afro-"][id$="-search"] .afro-field {
        flex: 1 1 50% !important;
        min-width: calc(50% - 1px) !important;
        border-bottom: 1px solid #e9ecef;
    }

    #afro-field-location {
        border-right: 1px solid #e9ecef !important;
    }

    #afro-field-date {
        border-right: none !important;
    }

    #afro-field-guests {
        border-right: 1px solid #e9ecef !important;
    }

    #afro-field-submit {
        flex: 1 1 50% !important;
        border-bottom: none;
        justify-content: center;
        padding: 12px;
        margin-left: 0;
    }

    #afro-search-btn {
        width: 100%;
    }
}

@media (max-width: 767px) {
    #afro-hotel-search,
    #afro-space-search,
    #afro-car-search,
    #afro-event-search,
    #afro-tour-search,
    [id^="afro-"][id$="-search"] {
        padding: 0 10px;
    }

    #afro-search-form {
        padding: 6px !important;
        border-radius: 16px !important;
    }

    #afro-search-fields {
        flex-direction: column !important;
        border-radius: 12px !important;
    }

    #afro-hotel-search .afro-field,
    #afro-space-search .afro-field,
    #afro-car-search .afro-field,
    #afro-event-search .afro-field,
    #afro-tour-search .afro-field,
    [id^="afro-"][id$="-search"] .afro-field {
        flex: 1 1 100% !important;
        min-width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e9ecef;
        padding: 14px 16px;
    }

    #afro-hotel-search .afro-field:last-child,
    #afro-space-search .afro-field:last-child,
    #afro-car-search .afro-field:last-child,
    #afro-event-search .afro-field:last-child,
    #afro-tour-search .afro-field:last-child,
    [id^="afro-"][id$="-search"] .afro-field:last-child {
        border-bottom: none;
    }

    #afro-hotel-search .afro-field-icon,
    #afro-space-search .afro-field-icon,
    #afro-car-search .afro-field-icon,
    #afro-event-search .afro-field-icon,
    #afro-tour-search .afro-field-icon,
    [id^="afro-"][id$="-search"] .afro-field-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 10px;
    }

    #afro-hotel-search .afro-field-icon i,
    #afro-space-search .afro-field-icon i,
    #afro-car-search .afro-field-icon i,
    #afro-event-search .afro-field-icon i,
    #afro-tour-search .afro-field-icon i,
    [id^="afro-"][id$="-search"] .afro-field-icon i {
        font-size: 18px;
    }

    #afro-field-submit {
        padding: 10px;
        margin-left: 0;
    }

    #afro-search-btn {
        width: 100%;
        height: 50px;
    }

    #afro-guests-dropdown {
        left: -16px;
        right: -16px;
        padding: 16px;
    }

    #afro-field-location .smart-search .bc-autocomplete {
        left: -16px;
        right: -16px;
    }
}
