/* =========================================
   1. COULEURS & CONFIGURATION
   ========================================= */
:root {
    --bg-dark: #0b0f13;
    --card-bg: #12181f;
    --border-color: #1f2937;
    --accent: #d4af37;
    --text-main: #e2e8f0;

    /* Couleurs de Rareté */
    --rarity-uncommon: #29c714c2;
    --rarity-rare: #00a9dd;
    --rarity-epic: #a335ee;
    --rarity-mythic: #e41453;
    --rarity-legendary: #fcc40d;
    --rarity-default: #2d3748;
}

/* =========================================
   2. BASE & LAYOUT
   ========================================= */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* =========================================
   3. NAVIGATION
   ========================================= */
nav {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}

nav a:hover, nav a.active {
    color: var(--accent);
}

/* =========================================
    4. SYSTÈME DE RECHERCHE & TOOLTIP
   ========================================= */
.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-wrapper:focus-within {
    border-color: #ffffff !important; /* Contour blanc pur */
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2); /* Légère lueur blanche */
    transition: all 0.2s ease;
}

/* Le conteneur qui encadre tout */
.search-wrapper {
    position: relative;
    width: 100%;
    background: #12181f;
    border-radius: 8px;
    border: 1px solid #2d3748;
    height: 50px;
    overflow: hidden;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid #2d3748;
}

/* Le calque de rendu (derrière l'input) */
/* Le calque de rendu */
#searchHighlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px 45px 15px 15px; /* Doit être STRICTEMENT identique à l'input */
    box-sizing: border-box;
    pointer-events: none;
    white-space: pre;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px;
    z-index: 1;
    /* On enlève display: flex pour éviter les décalages */
    line-height: 20px; /* On fixe une hauteur de ligne exacte */
    overflow: hidden;
    color: white !important;
}

/* L'input réel */
#searchInput {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 45px);
    height: 100%;
    padding: 15px 0 15px 15px; /* Padding identique (sauf droite car width calc) */
    background: transparent !important;
    border: none !important;
    color: transparent !important;
    caret-color: white !important;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px;
    z-index: 2;
    outline: none;
    line-height: 20px; /* Strictement identique au calque */
}

.info-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--border-color);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    z-index: 3;
    transition: 0.3s;
    border: 1px solid var(--border-color);
}

.info-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.tooltip {
    visibility: hidden;
    position: absolute;
    right: 0;
    top: 100%;
    background: #1a222b;
    color: var(--text-main);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    width: 320px;
    font-size: 0.8rem;
    z-index: 10;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s;
    line-height: 1.4;
}

.info-icon:hover + .tooltip {
    visibility: visible;
    opacity: 1;
}

/* =========================================
   5. CARTES (MOBS & ITEMS)
   ========================================= */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(212, 175, 55, 0.3);
}

/* MODIF : Lueur spécifique pour les cartes identifiées glow-card (ou glow-effect) */
.card.glow-card:hover, .card.glow-effect:hover {
    box-shadow: 0 0 20px rgba(255, 196, 0, 0.4);
    border-color: rgba(255, 208, 0, 0.6) !important;
}

.item-card {
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s, box-shadow 0.2s;
    cursor: default;
    overflow: hidden;
}

.item-card:hover {
    transform: translateY(-4px);
    filter: brightness(1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4) !important;
}

.item-card img {
    transition: transform 0.2s ease;
}

.item-card:hover img {
    transform: scale(1.1);
}

.accent-text { color: var(--accent); }

/* --- Animation des Images (Mobs & Items) --- */

/* --- Animation Fluide (Drops & Mobs) --- */

/* On applique uniquement la transition d'opacité et de transformation */
.cycling-img, 
.item-card img {
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out !important;
    opacity: 1;
    /* Les tailles sont gérées par ton HTML/JS (100px et 32px) */
}

/* État quand l'image est masquée par ton JS */
.cycling-img[style*="opacity: 0"], 
.item-card img[style*="opacity: 0"] {
    opacity: 0 !important;
    transform: scale(0.9); /* Petit effet de réduction fluide */
}

/* État quand l'image est affichée par ton JS */
.cycling-img[style*="opacity: 1"], 
.item-card img[style*="opacity: 1"] {
    opacity: 1 !important;
    transform: scale(1); /* Retour à la taille normale */
}



/* =========================================
   6. FOOTER
   ========================================= */
footer {
    flex-shrink: 0;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
    text-align: center;
}

/* =========================================
   7. BOUTON RETOUR EN HAUT (UI)
   ========================================= */
#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#backToTop:hover {
    background: var(--accent);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

#backToTop img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#backToTop:hover img {
    opacity: 1;
    filter: brightness(0) invert(0);
}

/* =========================================
   8. GESTION DU DROPS HOVER
   ========================================= */
.drop-hover-text { 
    display: none; 
    color: var(--text-muted);
    font-weight: bold;
}

.item-card.has-hover:hover .drop-value { 
    display: none; 
}

.item-card.has-hover:hover .drop-hover-text { 
    display: inline; 
}

/* Style spécifique pour les cartes de changelog */
.changelog-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
}

/* Conteneur du texte Markdown */
.md-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-main);
}

/* MODIF : Ligne de séparation '---' affinée sur les bords avec lueur au centre */
.md-content hr {
    border: none;
    height: 3px; /* Légèrement plus épais au centre */
    /* Dégradé : transparent -> doré -> transparent */
    background: radial-gradient(circle, var(--accent) 0%, rgba(212, 175, 55, 0) 80%);
    margin: 40px auto;
    width: 90%; /* On ne prend pas toute la largeur pour accentuer l'effet */
    opacity: 1;
    
    /* Lueur concentrée au milieu */
    filter: drop-shadow(0 0 5px var(--accent));
}

/* MODIF : Suppression totale des traits sous les titres Markdown */
.md-content h1, 
.md-content h2, 
.md-content h3 {
    border-bottom: none !important;
    border-top: none !important;
    padding-bottom: 0 !important;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: none !important; /* Au cas où un thème en ajouterait un */
}

/* Style pour les Tableaux Markdown */
.md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.md-content th {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--accent);
}

.md-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Style pour le code inline (texte entre ``) */
.md-content code {
    font-family: 'Consolas', monospace;
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.md-render h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-top: 15px;
}

.md-render ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.md-render li {
    margin-bottom: 5px;
}

.md-render blockquote {
    margin: 10px 0;
    padding: 5px 15px;
    border-left: 3px solid var(--accent);
    background: rgba(212, 175, 55, 0.05);
    font-style: italic;
    font-size: 0.8rem;
}

/* Bouton de téléchargement */
.btn-download-now {
    background: var(--accent);
    color: var(--bg-dark);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
}

.btn-download-now:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 800px) {
    .changelog-card div[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .btn-download-now {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* =========================================
   9. SYSTEME LIGHTBOX (AGRANDIR IMAGE)
   ========================================= */
#img-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#img-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#img-overlay.active {
    display: flex;
}

#img-overlay.active img {
    transform: scale(1);
}

/* Style pour indiquer que l'image est cliquable */
.md-content img {
    cursor: pointer;
    transition: opacity 0.3s;
}

.md-content img:hover {
    opacity: 0.9;
}


/* =========================================
   10. Ko-Fi Support
   ========================================= */
.kofi-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: rgba(212, 175, 55, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
        
iframe#kofiframe {
    border-radius: 8px;
    /* On force le fond de l'iframe à correspondre à ton site */
    background: #0b1118; 
}

.support-card-custom {
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    background: linear-gradient(145deg, rgba(20, 26, 35, 0.8), rgba(11, 17, 24, 1));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.support-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: bold;
}

.btn-support-gold {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--accent); /* Ton doré */
    color: #000 !important;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    text-transform: uppercase;
}

.btn-support-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--accent);
    filter: brightness(1.1);
}










/* =========================================
   11. text neon dans la search bar
   ========================================= */

/* Style unique pour tous les arguments de filtrage (@, #, *) */
.filter-glow {
    font-style: italic;
    color: #c6e4ff; /* Couleur de base blanche */
    font-weight: normal;
    /* L'effet de lueur (Glowing effect) */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 
                 0 0 10px rgba(0, 162, 255, 0.5); 
    transition: all 0.3s ease;
}

/* Optionnel : la lueur pulse un peu quand on écrit */
.search-wrapper:focus-within .filter-glow {
    text-shadow: 0 0 8px rgba(255, 255, 255, 1), 
                 0 0 15px rgba(0, 162, 255, 0.8);
}

/* Couleur d'alerte pour les filtres incompatibles */
.filter-conflict {
    color: #405685 !important;
    text-shadow: 0 0 8px rgba(41, 67, 122, 0.8) !important;
    font-style: italic;
    text-decoration: underline wavy #405685; /* Petit effet ondulé pour l'erreur */
}


.filter-negation {
    color: #ff446d !important;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.8) !important;
    font-style: italic;
}

.filter-system {
    color: #bb86fc; /* Une couleur distincte des autres filtres */
    font-style: normal;
    text-shadow: 0 0 5px rgba(187, 134, 252, 0.5);
}


/* =========================================
   12. Trophy Workbench Style
   ========================================= */

.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

/* La ligne verticale derrière */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50px; /* Aligné avec le milieu des numéros */
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    padding-left: 100px; /* Espace pour la ligne et le numéro */
}

.timeline-number {
    position: absolute;
    left: 20px;
    top: 20px;
    background: var(--accent);
    color: #000;
    font-weight: bold;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 0 15px var(--accent);
}

.workbench-card {
    display: flex !important;
    flex-direction: row;
    gap: 30px;
    padding: 25px !important;
}

.wb-visual {
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-visual img {
    max-width: 90%;
    max-height: 90%;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.upgrade-item {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.upgrade-item img {
    width: 32px;
    height: 32px;
}

.upgrade-details {
    display: flex;
    flex-direction: column;
}

.upgrade-details .amount {
    font-weight: bold;
    color: var(--accent);
}

.unlocks-box {
    background: rgba(var(--accent-rgb), 0.1);
    border-left: 3px solid var(--accent);
    padding: 10px 15px;
    margin: 15px 0;
    font-style: italic;
}



/* =========================================
   13. Wiki
   ========================================= */

.sub-nav {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
}

.sub-nav a {
    text-decoration: none;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
    padding: 5px 10px;
    border-radius: 4px;
}

.sub-nav a:hover {
    color: var(--accent);
}

.sub-nav a.active {
    color: #fff;
    background: rgba(var(--accent-rgb), 0.2);
    border: 1px solid var(--accent);
}


/* =========================================
   13. HYTALE UI RECYCLING
   ========================================= */

.recycling-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); 
    gap: 25px;
}

.recipe-card {
    background: #0d1117;
    border: 1px solid #2d3644;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-5px);
    border-color: #3e4b5d;
}

.recipe-header {
    background: #1a1f26;
    padding: 12px 15px;
    border-bottom: 1px solid #2d3644;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-title {
    font-weight: bold; 
    color: #eee; 
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.recipe-tier {
    color: var(--accent); 
    font-size: 0.7rem; 
    font-weight: 800;
    letter-spacing: 1px;
}

.recipe-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    background: rgba(18, 22, 28, 0.6);
    padding: 30px 20px;
}

/* Le Slot Hytale */
.item-slot {
    width: 64px;
    height: 64px;
    background: #1a1f26;
    border: 2px solid #2d3644;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.4);
}

.item-slot:hover {
    border-color: var(--accent);
    background: #232a33;
}

.result-slot {
    background: rgba(214, 55, 99, 0.05); 
    border-color: rgba(214, 55, 99, 0.4);
}

.item-slot img {
    width: 42px;
    height: 42px;
    image-rendering: pixelated;
    z-index: 2;
}

.item-amount {
    position: absolute;
    bottom: 2px;
    right: 5px;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.95rem;
    text-shadow: 2px 2px 0 #000;
    z-index: 3;
}

/* Flèche Hytale CSS */
.arrow-separator {
    width: 35px;
    height: 3px;
    background: var(--accent);
    position: relative;
    filter: drop-shadow(0 0 5px rgba(214, 55, 99, 0.4));
}

.arrow-separator::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -6px;
    border-left: 10px solid var(--accent);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.ingredient-list {
    display: flex;
    gap: 10px;
}

.recipe-footer {
    padding: 12px; 
    text-align: center; 
    font-size: 0.8rem; 
    color: #888; 
    background: #0a0d12;
    font-style: italic;
    border-top: 1px solid #2d3644;
}


/* --- HYTALE TOOLTIP --- */
.hytale-tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid #2d3644;
    padding: 8px 12px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 9999;
    display: none; /* Caché par défaut */
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
}

.item-slot:hover {
    border-color: var(--accent);
    background: #232a33;
    box-shadow: inset 0 0 10px rgba(214, 55, 99, 0.2);
}