/* /assets/css/common.css (VERSION FINALE NAVBAR) */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', sans-serif; background-color: #f4f7f9; color: #333; min-height: 100vh; display: flex; flex-direction: column; }
main { flex-grow: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Header & Navigation --- */
header.site-header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid #e6e6e6; position: sticky; top: 0; z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
header.site-header nav { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 1rem 20px; }
.logo-link { text-decoration: none; flex-shrink: 0; z-index: 10000; }
.logo { font-size: 2rem; font-weight: bold; background: linear-gradient(45deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 0.5rem; }
.logo::before { content: "🎮"; font-size: 1.5rem; }

.nav-links { list-style: none; margin: 0; display: flex; gap: 2rem; align-items: center; }
.nav-links a { text-decoration: none; color: #333; font-weight: 500; transition: color 0.3s; position: relative; padding: 0.5rem 0; white-space: nowrap; }
.nav-links a:hover { color: #667eea; }

.nav-actions { display: flex; align-items: center; gap: 1.5rem; flex-shrink: 0; z-index: 10000; }
.search-widget .search-form { position: relative; }
.search-widget input[type="search"] { padding: 0.5rem 2.5rem 0.5rem 1rem; border: 1px solid #ddd; border-radius: 50px; width: 200px; transition: width 0.3s; font-size: 0.9rem; }
.search-widget input[type="search"]:focus { width: 250px; outline: none; border-color: #667eea; }
.search-widget button { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 0.4rem; color: #888; }
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; cursor: pointer; color: #333; }
.mobile-menu-overlay { display: none; }
.mobile-search { display: none; }

/* --- Responsive pour la Navigation (VERSION FINALE CORRIGÉE) --- */
@media (max-width: 1024px) {
    .nav-links { display: none; }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: #333;
        z-index: 1002;
    }

    /* En MEDIUM (<=1024) on ne veut PAS afficher la recherche MOBILE dans le menu.
       Elle doit rester uniquement dans le header (la recherche du header est visible ici). */
    .mobile-search { display: none; }

    .mobile-menu-overlay.active {
        display: block;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex;
        position: fixed;
        top: 0; left: 0; right: 0;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 1rem 1rem;         /* <-- réduit l'espace général en haut */
        gap: 0.75rem;               /* <-- espace entre les liens réduit */
        z-index: 1001;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        animation: slideDown 0.3s ease-out;
    }

    .nav-links.active a { font-size: 1.1rem; } /* taille légèrement réduite si besoin */

    /* mobile-search hidden on medium screens (we already set .mobile-search display:none) */
}

/* CACHER LA RECHERCHE QUE POUR LES PETITS ÉCRANS (<=768px) */
/* Petit écran : afficher la recherche DANS le menu, mais réduire les marges */
@media (max-width: 768px) {
    /* cacher la recherche du header */
    .nav-actions .search-widget { display: none; }

    /* On veut que le menu commence juste sous le header : padding-top faible */
    .nav-links.active {
        justify-content: flex-start;
        /* On laisse top géré par le JS (navLinks.style.top = headerHeight) */
        padding-top: 0.5rem;     /* <-- réduit fortement l'espace entre header et contenu du menu */
    }

    .mobile-search {
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 0.5rem 1rem 0.5rem 1rem; /* <-- réduit espacement autour de la recherche */
        margin-bottom: 0.5rem;           /* <-- moins d'espace avant le premier lien */
        border-bottom: 1px solid #eee;
    }

    .mobile-search .search-form {
        width: 100%;
        max-width: 420px;
        position: relative;
    }

    .mobile-search input[type="search"] {
        width: 100%;
        padding: 0.6rem 3rem 0.6rem 1rem; /* un peu moins haut que précédemment */
        font-size: 1rem;
        border-radius: 999px;
    }

    .mobile-search button {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.25rem;
    }

    /* réduire l'espacement entre les éléments du menu (meilleure densité) */
    .nav-links.active li { margin: 0; padding: 0.25rem 0; }
    .nav-links.active { gap: 0.5rem; }
}

/* --- Footer --- */
footer { 
    background: linear-gradient(135deg, #4b5bb5 0%, #5a3b7e 100%); 
    color: #bdc3c7; 
    padding: 4rem 0 2rem 0; 
    margin-top: auto; 
    font-size: 0.95rem;
}
.footer-content { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 2.5rem; 
    margin-bottom: 3rem; 
}
.footer-section h3 { 
    margin-bottom: 1.5rem; 
    color: white; 
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}
/* Petite ligne décorative sous les titres du footer */
.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--admin-primary-color, #667eea);
}
.footer-section p { 
    line-height: 1.7; 
}
.footer-section a { 
    color: #bdc3c7; 
    text-decoration: none; 
    display: block; 
    margin-bottom: 0.75rem; 
    transition: color 0.3s ease, padding-left 0.3s ease;
}
.footer-section a:hover { 
    color: white;
    padding-left: 5px; /* Petit décalage au survol */
}
.footer-bottom { 
    text-align: center; 
    padding-top: 2rem; 
    border-top: 1px solid #46627f;
    color: #95a5a6; 
    font-size: 0.9rem; 
}

/* --- Utilitaires Communs --- */
.loading { display: block; text-align: center; padding: 2rem; color: #555; }
.loading-small { text-align:center; padding: 2rem; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(102, 126, 234, 0.3); border-top-color: #667eea; border-radius: 50%; margin: 0 auto 1rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Styles de Boutons Unifiés --- */
.btn { display: inline-block; padding: 0.8rem 1.8rem; border: none; border-radius: 50px; font-weight: 600; font-size: 0.95rem; text-decoration: none; text-align: center; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.btn:hover, .btn:focus { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); outline: none; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: white; }
.btn-secondary { background: transparent; color: #667eea; border: 2px solid #667eea; box-shadow: none; }
.btn-secondary:hover, .btn-secondary:focus { background: #667eea; color: white; box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2); }
.btn-white { background: white; color: #667eea; border: 2px solid white; }
.btn-white:hover, .btn-white:focus { background: transparent; color: white; }
.back-btn { background: linear-gradient(45deg, #667eea, #764ba2); color: white; border: none; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: 25px; text-decoration: none; font-weight: 500; transition: all 0.3s ease; }
.back-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4); }

/* === SECTION PARTAGE === */

.post-sharing {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.post-sharing h3 {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 1.3rem; /* Taille de l'icône SVG ou du texte */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.share-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.share-btn.facebook { background-color: #1877F2; }
.share-btn.twitter { background-color: #14171A; } /* Noir/Gris foncé de X */
.share-btn.linkedin { background-color: #0A66C2; }
.share-btn.copy-link { background-color: #7f8c8d; }

.copy-link-feedback {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: #2c3e50;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; /* Empêche l'interaction avec le message */
}

.copy-link-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- AMÉLIORATIONS ACCESSIBILITÉ ET CONTRASTE (CORRIGÉ) --- */

/* 1. Amélioration du contraste général sur fond blanc */
body {
    color: #2d3748; /* Gris foncé lisible pour le contenu principal */
}

/* 2. Focus visible pour la navigation au clavier (Accessibilité) */
:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* --- FIX : Rendre le texte BLANC sur les fonds sombres --- */

/* Section d'accueil (Hero violet) */
.home-intro, 
.home-intro h1, 
.home-intro p, 
.intro-card, 
.intro-card h2, 
.intro-card p {
    color: #ffffff !important;
}
/* On remet un peu de transparence sur les paragraphes des cartes pour le style */
.intro-card p {
    opacity: 0.9;
}

/* Footer (Pied de page foncé) */
footer {
    color: #bdc3c7; /* La couleur gris clair d'origine */
}
footer h3 {
    color: #ffffff !important; /* Titres en blanc */
}
footer p, 
footer li, 
footer a {
    color: #bdc3c7 !important; /* Texte en gris clair */
}
footer a:hover {
    color: #ffffff !important; /* Blanc au survol */
}