/**
 * Header Search Styles
 * Author: Sơn Lê
 */

/* Navbar Menu Desktop - inline horizontal */
@media (min-width: 992px) {
    #navbarNav {
        display: block !important;
    }
    
    #navbarNav .navbar-nav {
        display: flex;
        flex-direction: row;
        gap: 0;
    }
    
    #navbarNav .nav-item {
        margin-right: 5px;
    }
}

/* Navbar Menu Mobile - dropdown vertical */
@media (max-width: 991px) {
    #navbarNav {
        margin-top: 10px;
    }
}

/* Mobile Search Button */
.search-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: #e2e8f0 !important;
    font-size: 24px !important;
    cursor: pointer;
    padding: 10px 12px !important;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #9333ea !important;
}

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

/* Search Box Container - Desktop */
.search-box-container {
    max-width: 300px;
}

@media (min-width: 992px) {
    .search-box-container {
        max-width: 280px !important;
    }
}

#searchFormDesktop,
#searchFormMobile {
    display: flex;
    align-items: center;
    background: #1a202c;
    border: 1px solid #2d3748;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
    height: 40px;
    padding-right: 15px;
}

#searchFormDesktop:hover,
#searchFormMobile:hover {
    border-color: #9333ea;
}

/* Search icon inside form */
#searchFormDesktop .bi-search,
#searchFormMobile .bi-search {
    padding: 0 15px;
    display: flex;
    align-items: center;
    color: #94a3b8;
    background: transparent;
    font-size: 16px;
}

#searchFormDesktop button[type="submit"],
#searchFormMobile button[type="submit"] {
    border: none;
    background: #9333ea;
    color: white;
    padding: 0 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 18px;
    height: 40px;
    min-height: 40px;
}

#searchFormDesktop button[type="submit"]:hover,
#searchFormMobile button[type="submit"]:hover {
    background: #7e22ce;
}

#searchFormDesktop input,
#searchFormMobile input {
    flex: 1;
    border: none;
    padding: 10px 0;
    font-size: 14px;
    background: transparent;
    color: white;
    outline: none;
    height: 40px;
}

#searchFormDesktop input::placeholder,
#searchFormMobile input::placeholder {
    color: #64748b;
}

/* Search Suggest Dropdown */
#searchSuggestDesktop,
#searchSuggestMobile {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a202c;
    border: 1px solid #2d3748;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#searchSuggestDesktop a,
#searchSuggestMobile a {
    display: block;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #2d3748;
    transition: background 0.2s;
}

#searchSuggestDesktop a:hover,
#searchSuggestMobile a:hover {
    background: #2d3748;
}

#searchSuggestDesktop a:last-child,
#searchSuggestMobile a:last-child {
    border-bottom: none;
}

/* Mobile Dropdown */
.search-dropdown {
    animation: slideDown 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 992px) {
    .search-box-container {
        max-width: 100%;
    }
}

