/* Global Search Section Styles */

.global-search-section {
    position: relative;
    z-index: 100;
}

/* Search Type Buttons */
.search-type-btn {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.search-type-btn.active {
    background: #e1273d !important;
    color: #fff !important;
}

.search-type-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1) !important;
}

/* Live Search Results */
.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1050;
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-top: none;
}

.search-results-loading {
    padding: 25px;
    text-align: center;
    color: #19868b;
    font-size: 14px;
}

.search-results-loading i {
    margin-right: 8px;
}

.search-results-empty {
    padding: 30px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-results-empty::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Pro';
    font-weight: 300;
    display: block;
    font-size: 40px;
    color: #ddd;
    margin-bottom: 10px;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    color: inherit !important;
}

.search-result-item:hover {
    background: linear-gradient(90deg, #f8f9fa 0%, #fff 100%);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Result Image */
.search-result-image {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 14px;
    flex-shrink: 0;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-image img {
    transform: scale(1.05);
}

.search-result-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 22px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

/* Result Content */
.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.search-result-item:hover .search-result-title {
    color: #19868b;
}

.search-result-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Result Type Badge */
.search-result-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-type.offer {
    background: linear-gradient(135deg, rgba(225, 39, 61, 0.15) 0%, rgba(225, 39, 61, 0.08) 100%);
    color: #e1273d;
}

.search-result-type.project {
    background: linear-gradient(135deg, rgba(25, 134, 139, 0.15) 0%, rgba(25, 134, 139, 0.08) 100%);
    color: #19868b;
}

/* Results Footer */
.search-results-footer {
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    border-top: 1px solid #eee;
    text-align: center;
}

.search-results-footer a {
    color: #19868b;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.search-results-footer a:hover {
    color: #0d6d71;
    gap: 10px;
}

/* Emirates Dropdown Styling */
.emirate-selector {
    min-width: 180px;
}

/* Add margin/padding to separate from tabs */
.global-search-form .bootstrap-select.emirate-selector {
    margin-left: 25px;
}

.global-search-form .bootstrap-select.emirate-selector > .dropdown-toggle {
    border-radius: 4px 0 0 4px !important;
}

.emirate-selector + .dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
}

/* Advanced Search Filters */
#advanced-search-filters,
#advanced-search-filters-mobile {
    animation: slideDown 0.3s ease;
}

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

/* Search Button in Advanced Filters */
#advanced-search-filters .btn-secondary,
#advanced-search-filters-mobile .btn-secondary {
    background: #e1273d;
    border-color: #e1273d;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#advanced-search-filters .btn-secondary:hover,
#advanced-search-filters-mobile .btn-secondary:hover {
    background: #c91f33;
    border-color: #c91f33;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(225, 39, 61, 0.3);
}

/* Mobile Specific Styles */
@media (max-width: 991px) {
    .live-search-results {
        max-height: 350px;
        border-radius: 0 0 6px 6px;
    }
    
    .search-result-item {
        padding: 10px 14px;
    }
    
    .search-result-image {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    .search-result-meta {
        font-size: 11px;
    }
}

/* RTL Support */
[dir="rtl"] .search-result-image {
    margin-right: 0;
    margin-left: 14px;
}

[dir="rtl"] .search-results-loading i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .search-results-footer a {
    flex-direction: row-reverse;
}

[dir="rtl"] .search-result-meta {
    flex-direction: row-reverse;
}

/* Scrollbar Styling for Results */
.live-search-results::-webkit-scrollbar {
    width: 6px;
}

.live-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.live-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.live-search-results::-webkit-scrollbar-thumb:hover {
    background: #19868b;
}

/* Highlight Matching Text */
.search-result-title mark,
.search-result-meta mark {
    background: rgba(25, 134, 139, 0.2);
    color: #19868b;
    padding: 0 2px;
    border-radius: 2px;
}

/* Consistent Height for Form Elements */
.global-search-form .h-52,
.global-search-form input.h-52,
.global-search-form button.h-52 {
    height: 52px !important;
    line-height: 52px;
    padding-top: 0;
    padding-bottom: 0;
}

.global-search-form input.h-52 {
    line-height: normal;
    padding: 0 15px;
}

/* Global Search Area Slider Styles (jQuery UI) */
.global-search-slider-container {
    padding: 0 10px;
}

#global-sqft-slider.ui-slider {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    border: none;
    box-shadow: none;
}

#global-sqft-slider .ui-slider-range {
    background: #fff;
    border-radius: 3px;
}

#global-sqft-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    top: -6px;
}

#global-sqft-slider .ui-slider-handle:focus {
    outline: none;
}

.slider-values-display {
    font-size: 14px;
    letter-spacing: 0.5px;
}

#global-sqft-display {
    display: inline-block;
    min-width: 200px;
}
