<style>
/* ==========================================================================
   SYSTÈME INFOBULLE KEMAL - VERSION INTEGRALE CORRIGÉE (ANTI-BUG CARD)
   ========================================================================== */

/* Chargement de la police spécialisée pour les drapeaux */
@import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap');

[data-tooltip] { 
    position: relative; 
    cursor: help; 
}

/* On force l'utilisation de Noto Color Emoji pour les icônes et les conteneurs */
.badge-attribute, .tip-up {
    font-family: 'Noto Color Emoji', sans-serif !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center;
}

/* Base commune pour toutes les bulles noires */
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    /* Positionnement centré par défaut (au-dessus) */
    bottom: 130% !important;
    left: 50% !important;
    transform: translateX(-50%) !important; /* Centre parfaitement la bulle */
    
    background: rgba(33, 37, 41, 0.98);
    color: #fff;
    padding: 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    white-space: pre-line; /* Ajustement pour l'infobulle multi-ligne */
    max-width: 220px;
    z-index: 10000 !important;
    
    display: none;
    pointer-events: none; /* Évite de bloquer les clics */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Triangle / Flèche (Pointe vers le bas par défaut) */
[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 115% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 5px solid transparent;
    border-top-color: rgba(33, 37, 41, 0.98);
    display: none;
    z-index: 10000 !important;
}

/* --- VERSION tip-down (Pour forcer les bulles du haut à descendre) --- */
[data-tooltip].tip-down::before {
    top: 125% !important;
    bottom: auto !important;
}

[data-tooltip].tip-down::after {
    top: 110% !important;
    bottom: auto !important;
    border-top-color: transparent !important;
    border-bottom-color: rgba(33, 37, 41, 0.98) !important;
}

/* --- DÉCLENCHEMENT DE L'AFFICHAGE AU SURVOL (Pour 100% des cartes) --- */
[data-tooltip]:hover::before, 
[data-tooltip]:hover::after,
.tip-up:hover::before,
.tip-up:hover::after,
.badge-attribute:hover::before,
.badge-attribute:hover::after {
    display: block !important;
    opacity: 1 !important;
}


/* ==========================================================================
   RESTE DES STYLES INTERFACES (Tri, Rating, Chatbot, etc.)
   ========================================================================== */

/* Conteneur de tri horizontal défilant sur Mobile */
.sort-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

/* Style des badges de notation (Ratings) */
.zen-rating-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px; /* Plus d'espace interne */
    border-radius: 12px; /* Coins plus ronds */
    font-size: 0.75rem; /* Texte plus fin */
    font-weight: 500;
    color: #fff;
    margin-right: 5px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Ombre légère pour le relief */
    vertical-align: middle;
    border: 1px solid rgba(255,255,255,0.2); /* Bordure subtile */
}

/* Dégradés pour les notes (Moins agressifs) */
.rating-high { background: linear-gradient(135deg, #2ecc71, #1abc9c); }
.rating-mid  { background: linear-gradient(135deg, #f1c40f, #f39c12); color: #000 !important; }
.rating-low  { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* Boutons Favoris */
.btn-fav-action i {
    transition: color 0.2s ease-in-out;
}

/* Onglets de navigation (Tabs) */
.nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 0.9rem;
}
.nav-tabs .nav-link.active {
    color: #0d6efd !important;
    background: none !important;
    border-bottom: 2px solid #0d6efd !important;
}
.tab-content {
    min-height: 200px;
}

/* Interface Chatbot */
#chat-input {
    border-radius: 20px 0 0 20px !important;
    padding-left: 15px;
}
.input-group .btn {
    border-radius: 0 20px 20px 0 !important;
    padding-right: 15px;
}
#chat-content .badge {
    font-family: sans-serif;
    line-height: 1.4;
    font-weight: 400;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Réinitialisation propre des espacements Bootstrap 5 */
.my-5 {
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
}
.mt-5 { margin-top: 3rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Badges dans les fenêtres modales */
.badge-modal {
    display: block;          /* Force le badge à prendre toute la largeur disponible */
    width: 100%;             /* S'assure qu'il ne dépasse pas du parent */
    word-wrap: break-word;   /* Coupe les mots trop longs si besoin */
    white-space: normal;     /* Autorise le texte à passer sur plusieurs lignes */
    overflow: hidden;        /* Sécurité anti-débordement */
    box-sizing: border-box;  /* Inclut le padding dans le calcul de la largeur */
    margin-bottom: 8px;      /* Espace entre les badges */
}
</style>