﻿/* Desktop Styles */
.search-form-container {
    max-width: 800px;
    width: 100%;
}

.unified-search-box {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: stretch;
    transition: all 0.2s ease;
}

    .unified-search-box:focus-within {
        border-color: #0d6efd;
        box-shadow: 0 4px 20px rgba(13, 110, 253, 0.15);
    }

    .unified-search-box .input-wrapper {
        position: relative;
        flex: 1;
        display: flex;
        align-items: center;
    }

        .unified-search-box .input-wrapper:first-child {
            border-right: 1px solid #e9ecef;
        }

    .unified-search-box .form-control {
        border: none;
        box-shadow: none;
        background: transparent;
        font-size: 1rem;
        font-weight: 500;
        padding: 0.8rem 1rem;
        height: 100%;
        transition: background-color 0.15s ease;
    }

        .unified-search-box .form-control:focus {
            border: none;
            box-shadow: none;
            background: transparent;
        }

        .unified-search-box .form-control::placeholder {
            color: #6c757d;
            font-weight: 400;
        }

.search-btn {
    background: #0d6efd;
    color: white;
    border-radius: 0 0.75rem 0.75rem 0;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    border: none;
    padding: 0 1.5rem;
    min-height: 60px;
}

    .search-btn:hover:not(:disabled) {
        background: #0b5ed7;
        transform: translateY(-1px);
    }

    .search-btn:active:not(:disabled) {
        transform: translateY(0);
    }

    .search-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .search-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
        background: #0b5ed7;
    }

    .search-btn:hover {
        color: #fff;
    }

    .search-btn i {
        font-size: 1.1rem;
    }

/* Hide default Bootstrap Typeahead dropdown */
.twitter-typeahead .tt-menu,
.twitter-typeahead .tt-dropdown-menu,
.typeahead.dropdown-menu {
    display: none !important;
}

/* ========================================
   AUTOCOMPLETE SECTION HEADERS
   ======================================== */
.autocomplete-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.5px;
}

    .autocomplete-section-header:first-child {
        border-top: none;
        border-radius: 8px 8px 0 0;
    }

.clear-recent {
    color: #dc3545;
    cursor: pointer;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-transform: none;
    font-weight: 500;
}

    .clear-recent:hover {
        background: #fff;
        color: #c82333;
    }

/* ========================================
   PLACE META (Distance + Type)
   ======================================== */
.place-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.place-distance {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

    .place-distance::before {
        content: "📍";
        margin-right: 4px;
        font-size: 10px;
    }

/* ========================================
   RECENT SEARCH STYLING
   ======================================== */
.autocomplete-item .fa-clock-rotate-left {
    color: #6c757d !important;
}

.category-icon.recent-icon {
    color: #6c757d;
}

/* ========================================
   EXISTING AUTOCOMPLETE ITEM STYLES
   (Enhanced to work with new features)
   ======================================== */
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f1f3f5;
}

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

    .autocomplete-item:hover,
    .autocomplete-item.active {
        background: linear-gradient(to right, #f8f9fa, #fff);
        border-left: 3px solid #007bff;
        padding-left: 13px;
    }

    .autocomplete-item .place-name {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 14px;
    }

        .autocomplete-item .place-name > span:first-child {
            display: flex;
            align-items: center;
            flex: 1;
            color: #212529;
        }

.place-type {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #e9ecef;
    color: #495057;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

    /* Type-specific colors */
    .place-type.city {
        background: #d1ecf1;
        color: #0c5460;
    }

    .place-type.town {
        background: #d4edda;
        color: #155724;
    }

    .place-type.village {
        background: #fff3cd;
        color: #856404;
    }

/* ========================================
   CURRENT LOCATION OPTION
   ======================================== */
.current-location-option {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    margin: 8px;
    padding: 12px 14px;
}

    .current-location-option:hover {
        background: linear-gradient(135deg, #ffe0e0 0%, #fff5f5 100%);
        border-color: #ff6b6b;
        border-left: 3px solid #dc3545;
    }

    .current-location-option .place-type {
        background: #fff;
        border: 1px solid #ffc9c9;
        color: #dc3545;
    }

/* ========================================
   CATEGORY ICON
   ======================================== */
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    color: #007bff;
    font-size: 13px;
}

/* ========================================
   DROPDOWN CONTAINER - DESKTOP
   ======================================== */
.typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 8px;
    display: none;
}

    .typeahead-dropdown::-webkit-scrollbar {
        width: 6px;
    }

    .typeahead-dropdown::-webkit-scrollbar-track {
        background: #f1f3f5;
    }

    .typeahead-dropdown::-webkit-scrollbar-thumb {
        background: #adb5bd;
        border-radius: 3px;
    }

        .typeahead-dropdown::-webkit-scrollbar-thumb:hover {
            background: #868e96;
        }

/* ========================================
   LOADING, ERROR, AND EMPTY STATES
   ======================================== */
.loading-spinner {
    padding: 24px;
    text-align: center;
    color: #6c757d;
}

    .loading-spinner i {
        font-size: 20px;
        color: #007bff;
        margin-right: 8px;
    }

.error-message {
    padding: 24px;
    text-align: center;
    color: #dc3545;
}

    .error-message i {
        font-size: 20px;
        margin-right: 8px;
    }

.no-results {
    padding: 32px;
    text-align: center;
    color: #6c757d;
}

    .no-results i {
        font-size: 32px;
        margin-bottom: 12px;
        opacity: 0.5;
    }

    .no-results p {
        margin: 0;
        font-size: 14px;
    }

/* ========================================
   INPUT LOADING STATE
   ======================================== */
#txtLocation.loading,
#txtCategories.loading {
    background-image: linear-gradient(90deg, transparent 0%, rgba(0, 123, 255, 0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1280px) {
    .search-form-container {
        max-width: 650px;
    }
}

/* ========================================
   MOBILE STYLES (Modern App-like UX)
   ======================================== */
@media (max-width: 767.98px) {
    /* Container spacing */
    .search-form-container {
        padding: 0 1rem;
    }

    /* Stack inputs vertically in mobile */
    .unified-search-box {
        flex-direction: column;
        background: white;
        border-radius: 0.75rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid #e9ecef;
        overflow: visible;
    }

        .unified-search-box .input-wrapper {
            border-right: none !important;
            min-height: 56px;
        }

            .unified-search-box .input-wrapper:first-child {
                border-bottom: 1px solid #e9ecef;
            }

            .unified-search-box .input-wrapper:last-child {
                position: relative;
            }

        .unified-search-box .form-control {
            padding: 1rem;
            font-size: 1rem;
        }

        /* Mobile: Search button inside location field */
        .unified-search-box .input-wrapper:last-child .form-control {
            padding-right: 70px;
        }

    .search-btn {
        position: absolute;
        right: 0;
        top: 0;
        border-radius: 0 0 0.75rem 0;
        min-height: 56px;
        padding: 0 1.25rem;
        min-width: 60px;
    }

        .search-btn:hover:not(:disabled) {
            transform: none;
        }

        .search-btn:active:not(:disabled) {
            transform: scale(0.95);
        }

    /* Mobile typeahead dropdown positioning */
    .input-wrapper {
        position: relative;
    }

    .typeahead-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: -1px;
        right: -1px;
        max-height: 300px;
        font-size: 14px;
        border-radius: 0.75rem;
        margin-top: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    /* Adjust for first input wrapper */
    .unified-search-box .input-wrapper:first-child .typeahead-dropdown {
        top: calc(100%);
        border-radius: 0 0 0.75rem 0.75rem;
        border-top: 1px solid #e9ecef;
        margin-top: 0;
    }

    /* Adjust for second input wrapper */
    .unified-search-box .input-wrapper:last-child .typeahead-dropdown {
        top: calc(100% + 8px);
        border-radius: 0.75rem;
    }

    /* Mobile autocomplete adjustments */
    .autocomplete-item {
        padding: 12px 14px;
    }

        .autocomplete-item .place-name {
            font-size: 13px;
        }

    .place-distance {
        font-size: 10px;
        padding: 2px 6px;
    }

    .place-type {
        font-size: 9px;
        padding: 2px 6px;
    }

    .autocomplete-section-header {
        padding: 8px 14px;
        font-size: 10px;
    }

    .category-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
        margin-right: 8px;
    }

    /* Touch-friendly hover states */
    .autocomplete-item:hover {
        background: #f8f9fa;
        border-left: 3px solid #007bff;
    }
}
