/* ========================================================
   🟢 COMPLETE PREMIUM SEARCH BAR & CUSTOM DROPDOWN CSS
   ======================================================== */

/* --- 1. MAIN SEARCH CONTAINER --- */
.search-row {
    position: relative; 
    z-index: 5000;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important; 
    margin-top: 28px;
    background: #ffffff; 
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
}

.search-row:focus-within {
    border-color: #ffffff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    transform: translateY(-2px); 
}

/* --- 2. CUSTOM DROPDOWN (Left Side) --- */
.custom-dropdown {
    position: relative;
    flex: 0 0 auto !important;
    min-width: 140px;
    height: 100%;
}

.dropdown-selected {
    background-color: #f8fafc;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    border-right: 2px solid #e2e8f0;
    border-radius: 14px 0 0 14px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 8px;
    transition: all 0.3s ease;
}

/* Dropdown Arrow Icon */
.dropdown-selected::after {
    content: '▼';
    font-size: 10px;
    margin-left: auto;
    color: #4f46e5;
    transition: transform 0.3s ease;
}

/* When dropdown is clicked/open */
.custom-dropdown.open .dropdown-selected {
    background-color: #eef2ff;
    color: #4f46e5;
}

.custom-dropdown.open .dropdown-selected::after {
    transform: rotate(180deg);
}

/* --- 3. DROPDOWN OPTIONS LIST --- */
.dropdown-options {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 160px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 5001;
    border: 1px solid #f1f5f9;
}

.custom-dropdown.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-option:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.dropdown-option.active {
    background: #eef2ff;
    color: #4f46e5;
}

/* --- 4. SEARCH INPUT FIELD (Right Side) --- */
.search-row input[type="text"] {
    flex: 1 1 auto !important; 
    min-width: 0 !important;   
    width: 100% !important;
    padding: 16px 20px;
    border: none; 
    background: transparent; 
    font-size: 16px;
    font-weight: 500;
    outline: none;
    border-radius: 0 14px 14px 0; 
    color: #0f172a;
}

.search-row input[type="text"]::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* --- 5. LIVE SEARCH RESULTS POPUP (The Autocomplete box) --- */
.search-results-popup {
    position: absolute;
    top: 115%; 
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    z-index: 99999; 
    box-shadow: 
        0 20px 50px -10px rgba(0,0,0,0.3), 
        0 0 0 1px rgba(0,0,0,0.05);
    max-height: 0; 
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(-10px);
}

.search-results-popup.active {
    max-height: 450px;
    opacity: 1;
    transform: translateY(0);
    overflow-y: auto;
    padding: 8px 0;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background-color: #f8fafc; }

.search-thumb {
    width: 48px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #e2e8f0;
    flex-shrink: 0;
}

.search-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.search-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-info p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.search-empty, .search-loading {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

/* --- 6. MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    .custom-dropdown { 
        min-width: 110px; 
    }
    .dropdown-selected { 
        font-size: 13px; 
        padding: 14px 12px; 
    }
    .search-row input[type="text"] {
        padding: 14px 15px;
        font-size: 14px;
    }
}