/* ===========================================
   Global Search Styles (Navigation + Header Dropdown)
   =========================================== */

/* Navigation Search Container */
.nav-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-input {
    width: 0;
    padding: 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-search-container.expanded .nav-search-input {
    width: 200px;
    padding: 8px 12px;
    border-bottom-color: var(--primary-green);
    opacity: 1;
    margin-right: 10px;
}

.nav-search-input:focus {
    outline: none;
}

.nav-search-input::placeholder {
    color: #999;
}

/* Search Dropdowns (Navigation + Header) */
.nav-search-dropdown,
.header-search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 400px;
    max-height: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    overflow: hidden;
}

.header-search-dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 600px;
}

.nav-search-dropdown.show,
.header-search-dropdown.show {
    display: block;
}

/* Dropdown Filters */
.search-dropdown-filters {
    display: flex;
    gap: 5px;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.dropdown-filter {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: white;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-filter:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.dropdown-filter.active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

/* Dropdown Results */
.search-dropdown-results {
    max-height: 350px;
    overflow-y: auto;
}

.search-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.search-dropdown-item:hover {
    background: #f9f9f9;
}

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

.dropdown-item-type {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.dropdown-type-download {
    background: #e3f2fd;
    color: #1565c0;
}

.dropdown-type-news {
    background: #e8f5e9;
    color: #2e7d32;
}

.dropdown-type-faq {
    background: #fff3e0;
    color: #ef6c00;
}

.dropdown-item-content {
    flex: 1;
    min-width: 0;
}

.dropdown-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-title mark {
    background: #fff59d;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.dropdown-item-meta {
    font-size: 12px;
    color: #888;
}

/* All Results Link */
.search-dropdown-all {
    display: block;
    padding: 12px 15px;
    text-align: center;
    background: #f5f5f5;
    color: var(--primary-green);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    border-top: 1px solid #eee;
}

.search-dropdown-all:hover {
    background: #eee;
}

.search-dropdown-all i {
    margin-left: 5px;
}

/* Empty State */
.search-dropdown-empty {
    padding: 30px 15px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Search result highlighting */
.search-dropdown-item mark,
.search-result-item mark {
    background: #d5f0c6;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-search-container.expanded .nav-search-input {
        width: 150px;
    }
    
    .nav-search-dropdown {
        width: 300px;
        right: -50px;
    }
    
    .header-search-dropdown {
        width: calc(100vw - 40px);
        max-width: 500px;
    }
}