/* ================== AMÉLIORATION BARRE DE RECHERCHE INDEX.PHP ================== */
/* À ajouter à la fin de votre fichier styles/index.css */

/* Conteneur de la barre de recherche - styles existants conservés */
.searchBox {
    margin: 40px auto;
    display: flex;
    max-width: 660px;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 30px;
    position: relative;
    padding-right: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 100;
}

.searchBox:focus-within {
    box-shadow: 0 12px 48px rgba(213, 2, 65, 0.25);
    transform: translateY(-2px);
}

/* ================== CONTENEUR DE SUGGESTIONS ================== */
.search-suggestions {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.search-suggestions.active {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
    overflow-y: auto;
}

/* Scrollbar personnalisée */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #D50241, #ff1744);
    border-radius: 10px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff1744, #D50241);
}

/* ================== HEADER DES SUGGESTIONS ================== */
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(213, 2, 65, 0.05), rgba(255, 23, 68, 0.05));
    border-bottom: 2px solid rgba(213, 2, 65, 0.1);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    border-radius: 20px 20px 0 0;
}

.suggestions-count {
    background: linear-gradient(135deg, #D50241, #ff1744);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

/* ================== LISTE DES SUGGESTIONS ================== */
.suggestions-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 4px 0;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: linear-gradient(90deg, rgba(213, 2, 65, 0.08), rgba(255, 23, 68, 0.03));
    border-left-color: #D50241;
    transform: translateX(4px);
}

.suggestion-item:active {
    transform: translateX(4px) scale(0.98);
}

/* ================== ICÔNES/IMAGES DES SUGGESTIONS ================== */
.suggestion-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.suggestion-item:hover .suggestion-icon {
    box-shadow: 0 4px 12px rgba(213, 2, 65, 0.3);
    transform: scale(1.05);
}

.suggestion-icon.no-image {
    background: linear-gradient(135deg, rgba(213, 2, 65, 0.1), rgba(255, 23, 68, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid rgba(213, 2, 65, 0.2);
}

/* ================== CONTENU DES SUGGESTIONS ================== */
.suggestion-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestion-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.suggestion-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
    font-family: 'Space Mono', monospace;
}

.suggestion-meta span {
    display: inline-flex;
    align-items: center;
}

/* ================== BADGES ================== */
.suggestion-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.suggestion-badge.livre {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.suggestion-badge.film {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

.suggestion-badge.musique {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.suggestion-badge.jeu {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

/* ================== STATUT DE DISPONIBILITÉ ================== */
.suggestion-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.suggestion-status.disponible {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.suggestion-status.disponible::before {
    content: "●";
    color: #4CAF50;
}

.suggestion-status.indisponible {
    background: rgba(244, 67, 54, 0.15);
    color: #c62828;
}

.suggestion-status.indisponible::before {
    content: "●";
    color: #f44336;
}

/* ================== ÉTATS DE CHARGEMENT ET ERREUR ================== */
.suggestions-loading,
.no-suggestions {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-family: 'Space Mono', monospace;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(213, 2, 65, 0.1);
    border-top-color: #D50241;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-suggestions-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-suggestions-text {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

/* ================== ANIMATION D'ENTRÉE DES ITEMS ================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-suggestions.active .suggestion-item {
    animation: slideIn 0.3s ease forwards;
}

.search-suggestions.active .suggestion-item:nth-child(1) { animation-delay: 0.05s; }
.search-suggestions.active .suggestion-item:nth-child(2) { animation-delay: 0.1s; }
.search-suggestions.active .suggestion-item:nth-child(3) { animation-delay: 0.15s; }
.search-suggestions.active .suggestion-item:nth-child(4) { animation-delay: 0.2s; }
.search-suggestions.active .suggestion-item:nth-child(5) { animation-delay: 0.25s; }

/* ================== RESPONSIVE ================== */
@media (max-width: 768px) {
    .searchBox {
        max-width: calc(100% - 32px);
        margin: 20px 16px;
    }

    .search-suggestions {
        max-height: 400px;
    }

    .suggestion-item {
        padding: 10px 16px;
        gap: 12px;
    }

    .suggestion-icon {
        width: 45px;
        height: 45px;
    }

    .suggestion-title {
        font-size: 14px;
    }

    .suggestion-meta {
        font-size: 11px;
        gap: 6px;
    }

    .suggestions-header {
        padding: 14px 16px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .searchInput {
        font-size: 14px;
        padding: 14px 20px;
    }

    .suggestion-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}