/**
 * SEARCH AUTOCOMPLETE CYBERPUNK - La recherche la plus spectaculaire
 * Effets visuels jamais vus pour l'autocomplete
 */

/* Container de résultats */
.search-autocomplete {
    position: absolute;
    top: 104%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 50%, rgba(10, 10, 10, 0.98) 100%);
    border: 2px solid var(--neon-cyan);
    border-top: none;
    max-height: 600px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scaleY(0.8);
    transform-origin: top;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 20px 50px rgba(0, 245, 255, 0.3),
        inset 0 0 50px rgba(0, 245, 255, 0.1),
        0 0 100px rgba(189, 0, 255, 0.2);
    clip-path: polygon(
        0 0,
        100% 0,
        100% calc(100% - 20px),
        calc(100% - 20px) 100%,
        20px 100%,
        0 calc(100% - 20px)
    );
    z-index: 999999;
}

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

/* Effet de scan en arrière-plan */
.search-autocomplete::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 245, 255, 0.05) 50%,
        transparent 100%
    );
    animation: searchScan 4s linear infinite;
}

@keyframes searchScan {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* Header des résultats */
.search-results-header {
    padding: 20px;
    background: linear-gradient(90deg, rgba(189, 0, 255, 0.2) 0%, rgba(0, 245, 255, 0.2) 50%, rgba(189, 0, 255, 0.2) 100%);
    border-bottom: 1px solid rgba(0, 245, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

.search-loading {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.search-loading.active {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Conteneur des produits */
.search-results-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

/* Custom scrollbar */
.search-results-content::-webkit-scrollbar {
    width: 8px;
}

.search-results-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-purple);
}

.search-results-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan) 0%, var(--neon-purple) 100%);
    box-shadow: 0 0 10px var(--neon-cyan);
}

/* Item de résultat */
.search-result-item {
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    padding: 15px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: center;
    width: 100%;
    text-decoration: none;
    clip-path: polygon(
        0 0,
        calc(100% - 10px) 0,
        100% 10px,
        100% 100%,
        10px 100%,
        0 calc(100% - 10px)
    );
}

/* Effet de hover lumineux */
.search-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.search-result-item:hover::before {
    left: 100%;
}

.search-result-item:hover {
    transform: translateX(5px);
    border-color: var(--neon-cyan);
    background: rgba(0, 245, 255, 0.1);
    box-shadow: 
        -10px 0 20px rgba(0, 245, 255, 0.3),
        inset 0 0 20px rgba(0, 245, 255, 0.1);
}

/* Image produit */
.search-result-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid var(--neon-purple);
    transition: all 0.3s ease;
}

.search-result-item:hover .search-result-image {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-purple);
}

/* Info produit */
.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-result-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

.search-result-category {
    font-size: 12px;
    color: var(--neon-purple);
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Prix */
.search-result-price {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    white-space: nowrap;
    margin-left: auto;
    padding-left: 20px;
}

/* Highlight du texte recherché */
.search-highlight {
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-purple));
    color: white;
    padding: 0 4px;
    border-radius: 2px;
    font-weight: bold;
    animation: highlightPulse 1s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Message "Pas de résultats" */
.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--neon-cyan);
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: searchBounce 2s ease-in-out infinite;
}

@keyframes searchBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-results-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Suggestions de recherche */
.search-suggestions {
    padding: 15px 20px;
    background: rgba(189, 0, 255, 0.1);
    border-top: 1px solid rgba(189, 0, 255, 0.3);
}

.suggestions-title {
    font-size: 12px;
    color: var(--neon-purple);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-tag {
    padding: 5px 15px;
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.suggestion-tag:hover {
    background: var(--neon-cyan);
    color: black;
    transform: scale(1.1);
}

/* Animations d'entrée des items */
.search-result-item {
    animation: itemSlideIn 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes itemSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Délai progressif pour chaque item */
.search-result-item:nth-child(1) { animation-delay: 0.05s; }
.search-result-item:nth-child(2) { animation-delay: 0.1s; }
.search-result-item:nth-child(3) { animation-delay: 0.15s; }
.search-result-item:nth-child(4) { animation-delay: 0.2s; }
.search-result-item:nth-child(5) { animation-delay: 0.25s; }
.search-result-item:nth-child(6) { animation-delay: 0.3s; }

/* Effet de particules */
.search-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.search-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--neon-cyan);
    animation: floatParticle 8s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100%) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-results-content {
        max-height: 400px;
    }
    
    .search-result-item {
        padding: 10px;
        flex-wrap: wrap;
    }
    
    .search-result-image {
        width: 50px;
        height: 50px;
    }
    
    .search-result-name {
        font-size: 14px;
        max-width: 200px;
    }
    
    .search-result-price {
        font-size: 16px;
        width: 100%;
        margin-top: 5px;
        text-align: right;
    }
}

/* Mode sombre pour contraste */
.search-autocomplete {
    color: white;
}

/* Lien voir tous les résultats */
.search-view-all {
    display: block;
    padding: 20px;
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.1) 0%, rgba(189, 0, 255, 0.1) 100%);
    border-top: 1px solid rgba(0, 245, 255, 0.3);
    text-align: center;
    color: var(--neon-cyan);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-view-all::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.search-view-all:hover::before {
    left: 100%;
}

.search-view-all:hover {
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.2) 0%, rgba(189, 0, 255, 0.2) 100%);
    text-shadow: 0 0 10px var(--neon-cyan);
}