/* --- OHDB/css/header.css --- */

/* --- HAUT DE PAGE (Conteneur Principal) --- */
.pagetop {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center; /* Centre verticalement tous les éléments directs */
    height: 80px;
    padding: 0 30px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(9, 11, 14, 1) 0%, rgba(9, 11, 14, 0.4) 100%);
    z-index: 150;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Alignement générique des enfants flex */
.pagetop > div {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Partie Droite (Avatar/Login) */
.pagetop > div:last-child {
    position: relative; 
    z-index: 50;        
    margin-left: auto;  
    gap: 20px;
}

/* --- TITRE PRINCIPAL (Style Premium Once Human Rétabli) --- */
.titrepage {
    /* Force l'alignement avec la barre de recherche */
    height: 36px;
    display: flex;
    align-items: center;
    
    margin: 0; 
    padding: 0 10px;
    
    /* RETOUR DU STYLE NÉON COMPLET */
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: #fff;
    /* Lueur complexe Cyan/Blanc */
    text-shadow: 1px 1px 2px #a8fff0, 0 0 1em #c2ffeb, 0 0 0.2em #e1fff7;
    
    position: relative;
    z-index: 20;
    line-height: 1; /* Empêche les décalages verticaux */
}

/* --- RECHERCHE "CENTRAL" (Hauteur Forcée & Alignement) --- */
.header-search-trigger {
    /* On passe en relatif pour réintégrer le flux flexbox */
    position: relative;
    
    /* Gestion dynamique de la largeur pour empêcher la superposition */
    width: 100%;
    max-width: 380px; /* On garde la taille d'origine comme limite maximum */
    margin: 0 20px; /* Ajoute une marge de sécurité vitale entre le titre et les boutons de droite */
    flex-shrink: 1; /* Permet à la barre de rétrécir automatiquement si l'espace vient à manquer */
    
    /* CORRECTION HAUTEUR : On force 36px pour matcher le titre */
    height: 36px !important; 
    min-height: 36px !important;
    max-height: 36px !important;
    
    /* Style Glass Sombre */
    background: rgba(13, 17, 23, 0.9); 
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-radius: 4px;
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.header-search-trigger:hover {
    border-color: rgba(104, 253, 214, 0.6); /* Cyan */
    background: #0d1117;
    box-shadow: 0 0 15px rgba(104, 253, 214, 0.15);
}

/* Contenu Texte (Placeholder) */
.search-trigger-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1; 
    min-width: 0; 
    height: 100%; /* Prend toute la hauteur disponible */
    
    font-size: 0.85rem;
    color: #8b949e;
    font-family: 'h73light', sans-serif;
}

#animated-placeholder {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 34px; /* Centrage vertical du texte (36px - 2px bordure) */
}

.search-icon { 
    width: 14px; 
    height: 14px; 
    color: #68fdd6; 
    opacity: 0.8; 
    flex-shrink: 0; 
}

/* Raccourci (CTRL+K) */
.shortcut-hint {
    flex-shrink: 0; 
    margin-left: 10px;
    
    font-size: 0.65rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    line-height: normal;
}

.header-search-trigger:hover .shortcut-hint {
    color: #68fdd6;
    border-color: rgba(104, 253, 214, 0.3);
}


/* --- PROFIL DROPDOWN (Style Premium) --- */
.profile-dropdown {
    position: absolute;
    top: 100%; 
    right: 0;
    margin-top: 15px; 
    
    width: 320px; 
    
    background: #0f1216; /* Fond opaque */
    border: 1px solid #30363d;
    border-top: 3px solid #68fdd6; /* Accent Cyan */
    border-radius: 6px;
    
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    
    display: none; 
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

/* Zone Notifications */
.profile-notifications-area {
    background: #15191f; 
    max-height: 250px;
    overflow-y: auto;
    border-bottom: 1px solid #30363d;
}

.profile-notif-header {
    padding: 10px 15px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #68fdd6;
    background: rgba(104, 253, 214, 0.05);
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Liste Notifs */
ul.integrated-notif-list { list-style: none; padding: 0; margin: 0; }

ul.integrated-notif-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #8b949e;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}

ul.integrated-notif-list li a:hover {
    background: #1c2128;
    color: #e6edf3;
}

/* Notif NON LUE */
ul.integrated-notif-list li.unread a {
    background: rgba(104, 253, 214, 0.03); 
    border-left: 3px solid #68fdd6; 
    color: #fff;
}

.notif-text { display: block; font-size: 0.85rem; margin-bottom: 4px; line-height: 1.3; }
.notif-time { display: block; font-size: 0.7rem; opacity: 0.6; }

/* Liens Menu */
.profile-menu-links { background: #0f1216; padding: 5px 0; }

.profile-dropdown > a, 
.profile-menu-links a.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #c9d1d9;
    font-size: 0.9rem;
    text-decoration: none;
    font-family: 'h73light', sans-serif;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.profile-dropdown > a:hover,
.profile-menu-links a.menu-link:hover {
    background: #1f242c;
    color: #fff;
    padding-left: 25px; 
    border-left-color: #68fdd6;
}

.profile-dropdown hr {
    border: 0;
    border-top: 1px solid #30363d;
    margin: 0;
}

/* --- BUTTONS & AVATAR --- */
.avatar-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.avatar-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.avatar-container::after {
    content: '';
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: 15px; 
}

.notification-badge {
    position: absolute;
    top: -4px; right: -4px;
    background-color: #f85149;
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 18px; height: 18px;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 0 2px #15191f;
    pointer-events: none; 
}

#openLoginModalBtn, .btn-discord-premium {
    position: relative;
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

#openLoginModalBtn:hover, .btn-discord-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

/* --- MODALE RECHERCHE (Standard) --- */
.search-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000; align-items: center; justify-content: center; padding: 20px; }
.search-modal-overlay { position: absolute; width: 100%; height: 100%; background: rgba(5, 7, 10, 0.9); backdrop-filter: blur(8px); z-index: 1; }
.search-modal-container { position: relative; z-index: 2; width: 100%; max-width: 1100px; max-height: 80vh; background: #0d1116; border: 1px solid rgba(104, 253, 214, 0.2); border-radius: 8px; box-shadow: 0 0 50px rgba(0, 0, 0, 0.8); display: flex; flex-direction: column; overflow: hidden; animation: modalScaleIn 0.2s ease-out; }
@keyframes modalScaleIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
.search-modal-header { padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); background: rgba(255, 255, 255, 0.01); }
.search-input-wrapper { display: flex; align-items: center; gap: 15px; }
#globalSearchInput { flex: 1; background: transparent; border: none; color: #fff; font-family: 'h73bold', sans-serif; font-size: 1.4rem; outline: none; }
#globalSearchInput::placeholder { color: rgba(255,255,255,0.2); }
.search-modal-close { font-size: 0.7rem; color: rgba(104, 253, 214, 0.6); border: 1px solid rgba(104, 253, 214, 0.2); padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.search-modal-close:hover { background: rgba(104, 253, 214, 0.1); color: #68fdd6; }
.search-modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.search-modal-body::-webkit-scrollbar { width: 6px; }
.search-modal-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
.search-modal-body::-webkit-scrollbar-track { background: transparent; }

/* --- GRILLE DE RÉSULTATS --- */
.premium-search-grid { 
    display: grid; 
    /* Colonnes plus larges : on passe de 260px à 320px */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 15px; 
}

/* --- CARTE DE RÉSULTAT (Style Tech/Premium) --- */
.search-result-card { 
    display: flex; 
    align-items: center; 
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.8) 0%, rgba(10, 12, 16, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2px; 
    padding: 8px 12px; 
    text-decoration: none; 
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    
    /* NOUVEAU : On force une hauteur minimum pour tout uniformiser */
    min-height: 72px; 
    height: 100%;
}

/* Effet de balayage lumineux au survol */
.search-result-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s ease;
}

/* Animations au survol de la carte */
.search-result-card:hover { 
    background: linear-gradient(135deg, rgba(25, 30, 35, 0.9) 0%, rgba(15, 18, 22, 1) 100%);
    border-color: rgba(104, 253, 214, 0.4);
    transform: translateY(-3px) scale(1.02); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(104, 253, 214, 0.1);
    z-index: 2;
}
.search-result-card:hover::before {
    left: 200%;
}

/* Ligne de Rareté sur le côté gauche (lumineuse) */
.search-result-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #68fdd6;
    box-shadow: 0 0 8px #68fdd6;
    transition: width 0.2s ease;
}
.search-result-card:hover::after { width: 5px; }

/* Couleurs des Raretés (Adaptées avec Glow effect) */
.search-result-card.rarete-legendaire::after { background: #e5b946; box-shadow: 0 0 8px #e5b946; }
.search-result-card.rarete-epique::after     { background: #a35dcc; box-shadow: 0 0 8px #a35dcc; }
.search-result-card.rarete-rare::after       { background: #51a4d0; box-shadow: 0 0 8px #51a4d0; }
.search-result-card.rarete-commun::after     { background: #6da361; box-shadow: 0 0 5px #6da361; }
.search-result-card.rarete-basique::after    { background: #888;    box-shadow: 0 0 5px #888; }
.search-result-card.rarete-default::after    { background: #68fdd6; box-shadow: 0 0 8px #68fdd6; }

/* --- CONTENEUR IMAGE --- */
.result-card-image { 
    width: 50px;  /* On l'agrandit très légèrement pour le côté Premium */
    height: 50px; 
    flex-shrink: 0; /* LA CLÉ EST ICI : Empêche l'image de s'écraser si le texte est long */
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 15px; 
    margin-left: 5px; 
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
}

.search-result-card:hover .result-card-image {
    border-color: rgba(104, 253, 214, 0.5);
    background: rgba(0, 0, 0, 0.8);
}

.result-card-image img { 
    width: 85%; /* On force la taille par rapport au conteneur */
    height: 85%; 
    object-fit: contain; /* GARANTIT que l'image ne sera JAMAIS déformée */
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5)); 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.search-result-card:hover .result-card-image img { 
    transform: scale(1.15); 
}

/* --- TEXTE ET TYPOGRAPHIE --- */
.result-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.result-info h4 { 
    margin: 0; 
    color: #e6edf3; 
    font-family: 'h73bold', sans-serif; 
    font-size: 0.95rem; 
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    transition: color 0.2s;
    
    /* NOUVEAU : Force le texte à tenir sur 2 lignes max proprement */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    padding-right: 5px;
}

.search-result-card:hover .result-info h4 {
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
}

/* Petite ligne déco "Tech" sous le texte (Nouveau) */
.tech-deco-line {
    display: block;
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
    transition: width 0.3s, background 0.3s, box-shadow 0.3s;
}

.search-result-card:hover .tech-deco-line {
    width: 40px;
    background: #68fdd6;
    box-shadow: 0 0 5px #68fdd6;
}

/* Sécurité : cacher la flèche si elle traîne */
.result-arrow { display: none !important; }

.search-empty-state { text-align: center; padding: 40px 0; color: rgba(255, 255, 255, 0.3); }

/* Cursor */
.typing-cursor { animation: blink 1s infinite; color: #68fdd6; margin-left: 2px; font-weight: bold; display: inline-block; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Mobile */
@media (max-width: 768px) {
    .header-search-trigger { position: relative; left: auto; transform: none; top: auto; width: 100%; margin: 0 15px; flex: 1; height: 36px; }
    .pagetop { padding: 0 15px; gap: 10px; }
    .shortcut-hint { display: none; }
    .search-modal-container { width: 100%; height: 100%; border-radius: 0; border: none; }
}

/* --- STYLE BOUTON SUPPRESSION NOTIF --- */

/* Position relative pour pouvoir placer le bouton en absolu dedans */
ul.integrated-notif-list li {
    position: relative;
    transition: all 0.3s ease; /* Fluidité pour la suppression */
    overflow: hidden; /* Pour que l'animation ne déborde pas */
}

/* On laisse un peu de place à droite du texte pour la croix */
ul.integrated-notif-list li a {
    padding-right: 35px; 
}

/* Le bouton Croix */
.delete-notif-btn {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    
    background: transparent;
    border: none;
    color: #484f58; /* Gris discret au repos */
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0; /* Caché par défaut pour être très clean */
    z-index: 10;
}

/* Afficher la croix uniquement au survol de la ligne */
ul.integrated-notif-list li:hover .delete-notif-btn {
    opacity: 1;
}

/* Style au survol de la croix elle-même */
.delete-notif-btn:hover {
    color: #f85149; /* Rouge */
    background: rgba(248, 81, 73, 0.1); /* Fond rouge très léger */
}

/* --- GROUPES DE CATÉGORIES (Armes, Armures, etc.) --- */
.search-category-group {
    margin-bottom: 30px; /* Bel espace entre chaque bloc de catégorie */
    animation: fadeIn 0.4s ease-out;
}

/* Le titre de la catégorie */
.search-category-title {
    display: flex;
    align-items: center;
    font-family: 'h73bold', sans-serif;
    font-size: 1.2rem;
    color: #68fdd6; /* Cyan typique du jeu */
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(104, 253, 214, 0.4);
}

/* La ligne décorative "Scan/Tech" qui s'étire après le texte */
.search-category-title::after {
    content: '';
    flex: 1; /* Prend tout l'espace restant à droite */
    height: 2px;
    background: linear-gradient(90deg, rgba(104, 253, 214, 0.5) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    margin-left: 20px;
    box-shadow: 0 0 5px rgba(104, 253, 214, 0.2);
}

/* Petit point lumineux au début du titre (Optionnel mais très Premium) */
.search-category-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #fff;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 8px #fff, 0 0 15px #68fdd6;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}