/* Réinitialisation de base et police globale */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c2f33; /* Fond sombre */
    color: #ffffff;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Fait en sorte que le body prenne toute la hauteur de l'écran */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* Barre de navigation */
header {
    background-color: #23272a;
    padding: 1rem 2rem;
    border-bottom: 2px solid #7289da; /* Couleur principale Discord */
    width: 100%;
    position: relative; /* Contexte de positionnement pour le méga menu */
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #7289da;
}

nav .logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #7289da;
}

nav .logo span {
    font-size: 1.5rem;
    font-weight: bold;
    margin-left: 10px;
}

nav .logo img {
    height: 40px; /* Ajustez la hauteur selon votre logo */
    vertical-align: middle; /* Aligne l'image verticalement avec le texte des autres liens */
}

nav .logo a {
    background-color: transparent !important; /* S'assure qu'il n'y a pas de fond au survol */
    padding: 0;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1; /* Permet à ce conteneur de prendre l'espace restant */
    margin-left: 40px; /* Espace après le logo */
}

.nav-left, .nav-right {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-left li, .nav-right li {
    margin-left: 20px;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #7289da;
}

/* Contenu principal */
main {
    flex-grow: 1; /* Fait en sorte que le contenu principal pousse le pied de page vers le bas */
}

main h1 {
    margin-bottom: 20px;
    color: #7289da;
}

/* Style pour la page d'accueil */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.cta-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    background-color: #7289da;
    color: #ffffff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #5f73bc;
}

/* Pied de page */
footer {
    text-align: center;
    padding: 20px;
    background-color: #23272a;
    color: #99aab5;
    width: 100%;
}

/* Style pour le méga menu "Jeux" */
.jeux-menu-overlay {
    width: 100%;
    position: absolute; /* Positionné par rapport au header */
    z-index: 100;
    left: 0;
    top: 100%; /* Commence juste en dessous du header */
    background-color: #1e2124; /* Un peu plus sombre pour le contraste */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    max-height: 0; /* Caché par défaut */
    overflow: hidden;
    transition: max-height 0.5s ease-in-out; /* Animation sur la hauteur */
}

.jeux-menu-overlay.is-open {
    max-height: 500px; /* Hauteur maximale quand ouvert, à ajuster si besoin */
}

.jeux-menu-content {
    width: 80%;
    margin: auto;
    padding: 40px 20px;
}

.jeux-menu-overlay .close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    font-size: 40px;
    color: #ffffff;
    display: none; /* On cache le bouton de fermeture, il n'est plus utile */
    text-decoration: none;
    transition: transform 0.3s;
}

.jeux-menu-overlay .close-btn:hover {
    transform: rotate(90deg);
}

.mega-menu-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: left;
}

.mega-menu-column h3 {
    color: #7289da;
    margin-bottom: 15px;
    border-bottom: 2px solid #7289da;
    padding-bottom: 10px;
}

.mega-menu-column h3 a {
    color: inherit; /* Hérite de la couleur de h3 (#7289da) */
    text-decoration: none; /* Pas de soulignement */
    transition: opacity 0.2s;
}

.mega-menu-column ul {
    list-style: none;
    column-count: 2; /* Divise la liste en 2 colonnes */
    column-gap: 20px; /* Espace entre les colonnes */
}

.mega-menu-column ul li a {
    color: #b9bbbe;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    transition: color 0.2s;
}

.mega-menu-column ul li a:hover {
    color: #ffffff;
}

/* Style pour la page d'authentification */
.auth-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 30px;
    background-color: #23272a;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #b9bbbe;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: #2c2f33;
    border: 1px solid #4f545c;
    border-radius: 5px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit; /* Assure que la police est la même que le reste du site */
    resize: vertical; /* Permet le redimensionnement vertical uniquement */
}

.error-message {
    color: #f04747; /* Rouge Discord */
    margin-bottom: 15px;
    text-align: center;
    min-height: 1.2em; /* Réserve l'espace pour le message */
}

.form-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.form-toggle a {
    color: #7289da;
    text-decoration: none;
    font-weight: bold;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #99aab5;
    margin: 30px 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #4f545c;
}

.divider:not(:empty)::before {
    margin-right: .25em;
}

.divider:not(:empty)::after {
    margin-left: .25em;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
    transition: opacity 0.3s;
}

.social-btn {
    display: flex; /* Utiliser flexbox pour aligner l'icône et le texte */
    align-items: center;
    justify-content: center;
}

.social-btn img {
    margin-right: 10px; /* Espace entre l'icône et le texte */
}

.social-btn:hover {
    opacity: 0.9;
}

.btn-discord { background-color: #5865F2; }
.btn-steam { background-color: #1b2838; }
.btn-twitch { background-color: #9146FF; }
.btn-email { background-color: #7289da; }

/* Style pour le menu utilisateur connecté */
.user-menu {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

#username-display {
    padding: 5px 10px;
    border-radius: 5px;
    background-color: #7289da;
    color: white;
    font-weight: bold;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #23272a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 101; /* Augmenté pour être au-dessus du méga menu (z-index: 100) */
    border-radius: 5px;
    right: 0; /* Aligner à droite */
    top: 100%; /* Colle le menu juste en dessous de son parent pour éviter les "sauts" */
}

.dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover { background-color: #5f73bc; }

/* Affiche le menu déroulant lorsque la souris survole le conteneur .user-menu */
.user-menu:hover .dropdown-content {
    display: block;
}

/* --- Style pour la page de jeu --- */

.game-hero-section {
    position: relative;
    height: 40vh; /* Hauteur de la bannière (40% de la hauteur de la vue) */
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    align-items: flex-end; /* Aligne le contenu en bas */
    padding: 40px;
    box-sizing: border-box;
}

.game-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dégradé pour l'effet de fondu en bas */
    /* On ajoute une surcouche de couleur semi-transparente (le "voile")
       et on ajuste le dégradé pour qu'il soit plus subtil. */
    background: linear-gradient(to top, rgba(44, 47, 51, 1) 0%, rgba(44, 47, 51, 0.7) 50%, rgba(44, 47, 51, 0.4) 100%);
    z-index: 1;
}

.game-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px; /* Garde une largeur maximale pour la lisibilité */
    margin-right: auto; /* Aligne le contenu à gauche */
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px; /* Espace entre le logo et le titre */
}

.game-title-description h1 {
    margin: 0; /* Retire la marge par défaut du titre */
}
.game-title-description p {
    margin: 0.5rem 0 0 0; /* Ajoute une petite marge au-dessus de la description */
    font-size: 1.1rem;
    color: #ccc;
}

.game-logo {
    max-width: 150px; /* Taille maximale du logo */
    max-height: 150px;
    object-fit: contain;
}

/* --- Style pour les onglets de la page de jeu --- */

.game-tabs {
    border-bottom: 1px solid #4f545c;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.tab-link {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.1rem;
    color: #99aab5; /* Gris clair pour les onglets inactifs */
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px; /* Pour que la bordure inférieure se superpose à celle du conteneur */
}

.tab-link:hover {
    color: #fff;
}

.tab-link.active {
    color: #7289da; /* Couleur principale pour l'onglet actif */
    border-bottom-color: #7289da;
    font-weight: 600;
}

/* Style pour le contenu des onglets */
.tab-content {
    display: none; /* Caché par défaut */
    padding: 1rem 0;
    color: #dcddde;
}

.tab-content.is-visible {
    display: block; /* Visible si actif */
}

/* --- Styles pour le contenu des modules --- */

/* Contenu texte riche (tutoriels) */
.rich-text-content {
    line-height: 1.7;
}
.rich-text-content h1, .rich-text-content h2, .rich-text-content h3 {
    color: #7289da;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.rich-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}

/* Contenu carte (image ou embed) */
.map-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.map-embed-container, .video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.map-embed-container iframe, .video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Styles pour les boutons d'action dans les tableaux admin --- */
.actions-cell {
    display: flex;
    gap: 10px; /* Espace entre les boutons */
    align-items: center;
}

.cta-button-delete {
    background-color: #f04747; /* Rouge Discord pour la suppression */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.cta-button-delete:hover {
    background-color: #d84040;
}
