/* ============================================
   ENHANCED SEARCH DROPDOWN STYLES
   ============================================ */

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

[data-theme="dark"] .search-dropdown {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

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

/* Desktop dropdown - wider */
.search-dropdown--desktop {
    min-width: 380px;
    right: auto;
}

/* Mobile dropdown - full width */
.search-dropdown--mobile {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    bottom: auto;
    margin-top: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Dropdown Content */
.search-dropdown__content {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

/* Section Headers */
.search-dropdown__section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.search-dropdown__section-header i,
.search-dropdown__section-header svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.search-dropdown__count {
    margin-left: auto;
    font-weight: 600;
    color: var(--primary);
}

.search-dropdown__clear {
    margin-left: auto;
    padding: 4px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.search-dropdown__clear:hover {
    background: var(--card-secondary);
    color: var(--danger);
}

.search-dropdown__clear i,
.search-dropdown__clear svg {
    width: 12px;
    height: 12px;
}

/* Search Items */
.search-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    color: var(--text-primary);
}

.search-dropdown__item:hover,
.search-dropdown__item.selected {
    background: var(--card-secondary);
}

.search-dropdown__item.selected {
    background: var(--primary-light);
}

.search-dropdown__item--recent {
    color: var(--text-secondary);
}

.search-dropdown__item--recent i,
.search-dropdown__item--recent svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-dropdown__item--more {
    justify-content: center;
    color: var(--primary);
    font-weight: 500;
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
    padding-top: 12px;
}

.search-dropdown__item--more i,
.search-dropdown__item--more svg {
    width: 16px;
    height: 16px;
}

/* Item Icon */
.search-dropdown__item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--icon-color, var(--primary));
    color: white;
    flex-shrink: 0;
}

.search-dropdown__item-icon i,
.search-dropdown__item-icon svg {
    width: 18px;
    height: 18px;
}

/* Item Content */
.search-dropdown__item-content {
    flex: 1;
    min-width: 0;
}

.search-dropdown__item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown__item-name mark {
    background: var(--warning-bg);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

.search-dropdown__item-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Status Badges */
.search-dropdown__badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.search-dropdown__badge--new {
    background: var(--success-light);
    color: var(--success-color);
}

.search-dropdown__badge--beta {
    background: var(--warning-bg);
    color: var(--warning-color);
}

/* Categories */
.search-dropdown__category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
}

.search-dropdown__category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-dropdown__category-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.search-dropdown__category-item i,
.search-dropdown__category-item svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.search-dropdown__category-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--card-secondary);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Featured Tools */
.search-dropdown__featured-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 4px;
}

.search-dropdown__item--featured {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    gap: 8px;
}

.search-dropdown__item--featured .search-dropdown__item-icon {
    width: 40px;
    height: 40px;
}

.search-dropdown__item--featured .search-dropdown__item-content {
    width: 100%;
}

.search-dropdown__item--featured .search-dropdown__item-name {
    font-size: 12px;
}

/* Empty State */
.search-dropdown__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.search-dropdown__empty i,
.search-dropdown__empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.search-dropdown__empty span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.search-dropdown__empty p {
    font-size: 12px;
    margin-top: 4px;
}

/* Footer */
.search-dropdown__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--card-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 11px;
}

.search-dropdown__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.search-dropdown__hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 10px;
    font-family: inherit;
    color: var(--text-secondary);
}

.search-dropdown__all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.15s ease;
}

.search-dropdown__all:hover {
    color: var(--primary-dark);
}

.search-dropdown__all i,
.search-dropdown__all svg {
    width: 14px;
    height: 14px;
}

/* Scrollbar */
.search-dropdown__content::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown__content::-webkit-scrollbar-track {
    background: transparent;
}

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

.search-dropdown__content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .search-dropdown--desktop {
        display: none;
    }
    
    .search-dropdown__category-list,
    .search-dropdown__featured-list {
        grid-template-columns: 1fr;
    }
    
    .search-dropdown__footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-dropdown__hint {
        display: none;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion) {
    .search-dropdown {
        transition: none;
    }
}
