/* ==========================================
   SEARCH RESULTS DROPDOWN
   ========================================== */

.hero-search {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 15, 30, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    margin-top: 8px;
    max-height: 500px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(139, 92, 246, 0.15);
}

.search-results.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-primary, #e2e8f0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-align: left;
}

.search-result-item:last-of-type {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background: rgba(139, 92, 246, 0.1);
}

.search-result-item.active {
    border-left: 3px solid var(--primary-color, #8b5cf6);
    padding-left: 17px;
}

/* Logo */
.search-result-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

/* Info - ALL LEFT ALIGNED */
.search-result-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    justify-content: flex-start;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary, #e2e8f0);
    text-align: left;
}

.search-result-name mark {
    background: rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 6px 0;
    line-height: 1.4;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.75rem;
    justify-content: flex-start;
}

.search-result-category {
    color: var(--text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-rating {
    color: #fbbf24;
}

.search-result-pricing {
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.search-result-pricing.freemium {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.search-result-pricing.free {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.search-result-pricing.paid {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Arrow */
.search-result-arrow {
    color: var(--text-muted, #64748b);
    font-size: 1.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-result-item:hover .search-result-arrow,
.search-result-item.active .search-result-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Badges in Search */
.search-result-header .search-badge {
    font-size: 0.5625rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-badge-new {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.search-badge-popular {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.search-badge-trending {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* No Results */
.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted, #64748b);
}

.search-no-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-no-results p {
    font-size: 0.9375rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 8px 0;
}

.search-no-results small {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
}

/* Results count header */
.search-results-header {
    padding: 10px 20px;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

/* Scrollbar */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* ==========================================
   FIX: Hero Stats above header
   ========================================== */
.hero-stats {
    position: relative;
    z-index: 1;
}

.hero-section {
    position: relative;
    z-index: 1;
}

/* Make sure header stays on top */
.site-header {
    z-index: 1000 !important;
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .search-results {
        position: fixed;
        top: auto;
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-height: 55vh;
        border-radius: 16px;
        margin-top: 0;
    }
    
    .search-result-item {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .search-result-logo {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .search-result-name {
        font-size: 0.875rem;
    }
    
    .search-result-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 1;
    }
    
    .search-result-arrow {
        display: none;
    }
}

/* Animation for results */
.search-results.visible .search-result-item {
    animation: slideInResult 0.25s ease forwards;
    opacity: 0;
}

@keyframes slideInResult {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results.visible .search-result-item:nth-child(1) { animation-delay: 0ms; }
.search-results.visible .search-result-item:nth-child(2) { animation-delay: 25ms; }
.search-results.visible .search-result-item:nth-child(3) { animation-delay: 50ms; }
.search-results.visible .search-result-item:nth-child(4) { animation-delay: 75ms; }
.search-results.visible .search-result-item:nth-child(5) { animation-delay: 100ms; }
.search-results.visible .search-result-item:nth-child(6) { animation-delay: 125ms; }
.search-results.visible .search-result-item:nth-child(7) { animation-delay: 150ms; }
.search-results.visible .search-result-item:nth-child(8) { animation-delay: 175ms; }


/* ============================================
   View All Results Link
   ============================================ */
.search-view-all {
    display: block;
    padding: 14px 20px;
    text-align: center;
    color: var(--primary-color, #a855f7);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    background: rgba(168, 85, 247, 0.05);
}

.search-view-all:hover {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}