/* Search Dropdown - Header Integrated */

.search-dropdown-wrapper {
    position: relative;
    z-index: 1000;
}

/* Search Trigger Button */
.search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.search-trigger:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.theme-dark .search-trigger:hover {
    background: rgba(0, 255, 65, 0.05);
}

.theme-light .search-trigger:hover {
    background: rgba(139, 90, 43, 0.05);
}

.search-trigger i {
    font-size: 0.9rem;
}

.search-trigger-shortcut kbd {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.search-dropdown-wrapper.active .search-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dark .search-dropdown {
    background: rgba(15, 15, 20, 0.98);
    border-color: rgba(0, 255, 65, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 255, 65, 0.1);
}

.theme-light .search-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(139, 90, 43, 0.2);
}

/* Search Input */
.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.search-icon {
    font-size: 0.9rem;
    opacity: 0.5;
}

.theme-dark .search-icon {
    color: var(--accent-color);
    opacity: 0.7;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-esc {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 6px;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.search-category {
    padding: 6px 10px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 12px;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-secondary);
}

.theme-dark .search-result-item:hover,
.theme-dark .search-result-item.selected {
    background: rgba(0, 255, 65, 0.08);
}

.theme-light .search-result-item:hover,
.theme-light .search-result-item.selected {
    background: rgba(139, 90, 43, 0.08);
}

.search-item-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.theme-dark .search-item-icon {
    background: rgba(0, 255, 65, 0.1);
    color: var(--accent-color);
}

.theme-light .search-item-icon {
    background: rgba(139, 90, 43, 0.1);
    color: #8b5a2b;
}

.search-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-title mark {
    background: transparent;
    color: var(--accent-color);
    font-weight: 600;
}

.search-item-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.15s;
}

.search-result-item:hover .search-item-arrow,
.search-result-item.selected .search-item-arrow {
    opacity: 0.5;
}

/* Empty State */
.search-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Footer */
.search-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

.search-footer-keys {
    display: flex;
    gap: 8px;
}

.search-footer-keys kbd {
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    border: 1px solid var(--border-color);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .search-dropdown {
        position: fixed;
        top: 60px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .search-trigger {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    
    .search-trigger-shortcut {
        display: none;
    }
    
    .search-footer {
        display: none;
    }
}
