/* Search Container */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 20px;
    max-width: 600px;
    position: relative;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
    z-index: 2;
}

#globalSearchInput {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #eee;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#globalSearchInput:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.6);
    border-color: var(--accent-color, #e74c3c);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

/* Dropdown Results */
.search-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
    display: none; /* Hidden by default */
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-section-title {
    padding: 8px 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    background: #111;
    font-weight: bold;
    letter-spacing: 1px;
    border-bottom: 1px solid #222;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #ccc;
    transition: background 0.2s;
    border-bottom: 1px solid #222;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #252525;
    color: #fff;
}

.search-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.search-info {
    display: flex;
    flex-direction: column;
}

.search-primary {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-secondary {
    font-size: 0.75rem;
    color: #777;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Scrollbar */
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-dropdown::-webkit-scrollbar-track {
    background: #111;
}
.search-dropdown::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 15px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-center {
        display: none; /* Hide on mobile initially */
        position: absolute;
        top: 100%; /* Below header */
        left: 0;
        width: 100%;
        margin: 0;
        background: rgba(15, 15, 15, 0.95);
        padding: 15px;
        max-width: none;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        z-index: 99;
    }
    
    .header-center.mobile-active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    .mobile-search-btn {
        display: block;
    }

    /* Adjust dropdown position on mobile */
    .search-dropdown {
        position: static; /* Inside the container */
        margin-top: 10px;
        max-height: 300px;
    }
}
