/* --- VARIABLES GLOBALES --- */
:root {
    --color-text: #E0E0E0;
    --color-text-dark: #B0B0B0;
    --color-accent: #FFD700; 
    --color-bg-glass: rgba(10, 10, 10, 0.25);
    --font-sober: 'Lato', sans-serif;
    --font-jdr: 'Merriweather', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sober);
    color: var(--color-text);
    line-height: 1.7;
    background: linear-gradient(-45deg, #4a3308, #593b04, #674a0a, #784c13);
    background-size: 400% 400%;
    animation: liquid-gradient 20s ease infinite;
    background-attachment: fixed;
}

@keyframes liquid-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

h1, h2, h3 {
    font-family: var(--font-jdr);
    color: white;
    margin-bottom: 1rem;
    font-weight: 700;
}
h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 2.5rem; }
h3 { font-size: 1.5rem; color: var(--color-accent); }
p { margin-bottom: 1rem; }

/* --- GLASSMORPHISM --- */
.glassmorphism {
    background: var(--color-bg-glass);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
}

/* --- NAVBAR --- */
.navbar { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; padding: 1rem 0; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.navbar-brand { font-family: var(--font-jdr); font-size: 1.5rem; color: white; text-decoration: none; font-weight: 700; }
.navbar-nav { position: relative; display: flex; align-items: center; }

.nav-bubble {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    
    /* Optimisation des performances */
    pointer-events: none;
    will-change: transform, width, opacity;
    
    /* Transition plus fluide et spécifique */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                width 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.3s ease;
}

.navbar-nav a {
    color: var(--color-text); text-decoration: none; margin-left: 1rem; padding: 5px 10px;
    border-radius: 8px; transition: color 0.3s ease;
}
.navbar-nav a:hover { color: white; }

/* --- UI ELEMENTS --- */
.hero { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.hero-content { max-width: 700px; }
.hero p { font-size: 1.2rem; color: var(--color-text); margin-bottom: 2rem; }

.cta-button {
    display: inline-block; background: var(--color-accent); color: #111;
    font-family: var(--font-jdr); font-size: 1.1rem; font-weight: 700;
    text-decoration: none; padding: 0.8rem 2rem; border-radius: 8px;
    border: none; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }

.cta-button.secondary {
    background: transparent; border: 2px solid var(--color-accent); color: var(--color-accent); margin-top: 1rem;
}
.cta-button.secondary:hover { background: var(--color-accent); color: #111; }

.campaigns { padding: 6rem 0; background: rgba(0, 0, 0, 0.2); }
.cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.card { display: flex; flex-direction: column; }
.card span { margin-top: auto; padding-top: 1rem; font-style: italic; color: var(--color-text-dark); }

.clickable-card { cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; position: relative; }
.clickable-card:hover {
    transform: translateY(-5px); background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1); border-color: var(--color-accent);
}
.info-hover {
    display: block; margin-top: 10px; font-size: 0.8rem; color: var(--color-accent);
    opacity: 0; transition: opacity 0.3s; text-align: right;
}
.clickable-card:hover .info-hover { opacity: 1; }

.rules { padding: 6rem 0; }
.rules-content { max-width: 800px; margin: 0 auto; }
.rules-content ul { list-style: none; padding-left: 1rem; }
.rules-content li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.rules-content li::before { content: '◇'; position: absolute; left: 0; top: 0; color: var(--color-accent); font-weight: 700; }

.card, .hero-content { transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; }
.card:hover, .hero-content:hover { transform: translateY(-8px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); background: rgba(25, 25, 25, 0.4); }

footer { text-align: center; padding: 2rem 0; background: #0A0A0A; color: var(--color-text-dark); font-size: 0.9rem; }

/* --- AUTH & PROFIL --- */
.login-btn {
    background-color: #5865F2; color: white !important; font-weight: bold; margin-left: 1rem;
    padding: 5px 15px; border-radius: 20px; transition: transform 0.2s;
}
.login-btn:hover { background: #4752C4; transform: translateY(-2px); }

.user-profile {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 25px; margin-left: 1rem;
    border: 1px solid rgba(255,255,255,0.2); transition: background 0.3s;
}
.user-profile:hover { background: rgba(255,255,255,0.2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.logout-link { color: #ff6b6b !important; margin-left: 5px; font-weight: bold; padding: 0 !important; }
.logout-link:hover { color: #ff4c4c !important; background: none !important; }

.badge-mj {
    font-size: 0.7rem; background: #FFD700; color: black; padding: 2px 6px;
    border-radius: 10px; margin-left: 5px; font-weight: bold;
}

.mj-name { font-size: 0.9rem; color: #aaa; display: block; margin-top: auto; padding-top: 10px; }
.full-width { grid-column: 1 / -1; }

.profile-dashboard { text-align: center; padding: 3rem 2rem; min-height: 60vh; }
.profile-header { margin-bottom: 2rem; }

/* --- STYLE FORMULAIRE INTÉGRÉ (DANS LA PAGE) --- */
.embedded-form-container {
    position: relative;
    width: 100%;
    height: auto;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    animation: expandForm 0.5s ease;
    margin-top: 2rem;
}

/* --- STYLE POPUP MODALE (FIXE EN PLEIN ECRAN) --- */
/* C'est ici que ça bloquait : une classe séparée pour la popup de détails */
.popup-overlay {
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px);
    z-index: 2000; /* Très haut pour passer au dessus de tout */
    display: flex; 
    justify-content: center; 
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-glass {
    background: rgba(20, 20, 20, 0.4);
    border-radius: 24px; padding: 3rem; width: 90%; max-width: 600px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-input {
    width: 100%; padding: 15px; background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px;
    color: white; font-size: 1rem; transition: all 0.3s ease; font-family: var(--font-sober);
}
.glass-input:focus {
    outline: none; background: rgba(0, 0, 0, 0.6);
    border-color: var(--color-accent); box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

select.glass-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFD700%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 1rem center; background-size: 0.8rem;
}
select.glass-input option { background-color: #222; color: white; }

.close-btn {
    position: absolute; top: 15px; right: 20px; background: none; border: none;
    color: #aaa; font-size: 2rem; cursor: pointer; transition: color 0.3s;
}
.close-btn:hover { color: white; }

.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--color-accent); font-weight: bold; }

.glow-effect { box-shadow: 0 0 10px rgba(255, 215, 0, 0.3); transition: all 0.3s ease; }
.glow-effect:hover { box-shadow: 0 0 25px rgba(255, 215, 0, 0.6); transform: scale(1.05); }

@keyframes expandForm { from { opacity: 0; transform: scaleY(0.9); } to { opacity: 1; transform: scaleY(1); } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- FLATPICKR CORRIGÉ (Transparence et Couleurs) --- */
.flatpickr-calendar {
    background: rgba(10, 10, 10, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
    border-radius: 16px !important;
    font-family: var(--font-sober) !important;
    color: var(--color-text) !important;
    margin-top: 10px !important;
    z-index: 99999 !important;
}

.flatpickr-months,
.flatpickr-month, 
.flatpickr-months .flatpickr-month,
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    background: transparent !important;
    color: var(--color-accent) !important;
    fill: var(--color-accent) !important;
}

.flatpickr-current-month {
    color: var(--color-accent) !important;
    font-family: var(--font-jdr) !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    padding-top: 0 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: var(--color-accent) !important;
    font-weight: bold; appearance: none;
}
.flatpickr-current-month .numInputWrapper input { color: var(--color-accent) !important; }
.flatpickr-months .flatpickr-prev-month:hover svg, 
.flatpickr-months .flatpickr-next-month:hover svg { fill: white !important; }

.flatpickr-weekdays {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; margin-bottom: 5px !important;
}
span.flatpickr-weekday {
    background: transparent !important; color: var(--color-text-dark) !important; font-weight: bold;
}

.flatpickr-day {
    color: var(--color-text) !important; background: transparent !important;
    border: 1px solid transparent !important; border-radius: 8px !important;
}
.flatpickr-day:hover {
    background: rgba(255, 215, 0, 0.15) !important; border-color: var(--color-accent) !important;
}
.flatpickr-day.selected, .flatpickr-day.selected:hover {
    background: var(--color-accent) !important; color: #000 !important;
    border-color: var(--color-accent) !important; font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}
.flatpickr-day.today { border-color: rgba(255, 255, 255, 0.3) !important; }

.flatpickr-time {
    background: transparent !important; border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.flatpickr-time input {
    background: transparent !important; color: var(--color-text) !important;
    font-family: var(--font-sober) !important;
}
.flatpickr-time .flatpickr-time-separator { color: var(--color-accent) !important; }
.flatpickr-time input:hover, .flatpickr-time input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
}
.flatpickr-calendar:before, .flatpickr-calendar:after { display: none !important; }

/* Ajout pour la page active */
.navbar-nav a.active {
    color: var(--color-accent);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Style spécifique pour la recherche */
.search-container:focus-within {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    border-color: var(--color-accent);
}

/* --- TOAST NOTIFICATION (Style Liquid Glass) --- */
#toast-notification {
    visibility: hidden;
    min-width: 280px;
    
    /* --- EFFET GLASSMORPHISM --- */
    /* Fond légèrement doré et très transparent */
    background: rgba(255, 215, 0, 0.1); 
    /* Le flou d'arrière-plan qui fait l'effet "liquide/verre" */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Bordure brillante dorée */
    border: 1px solid rgba(255, 215, 0, 0.5);
    /* Ombre portée douce pour le faire flotter */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    
    /* Texte en OR pour qu'il ressorte bien */
    color: var(--color-accent);
    
    text-align: center;
    border-radius: 12px; /* Bords plus arrondis */
    padding: 16px 24px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    /* Initialement, il est un peu plus bas et invisible */
    transform: translateX(-50%) translateY(30px); 
    
    font-family: var(--font-jdr);
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0;
    /* Animation fluide avec un petit effet de "rebond" à l'arrivée */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Quand la notification apparaît */
#toast-notification.show {
    visibility: visible;
    opacity: 1;
    /* Il remonte à sa position finale */
    transform: translateX(-50%) translateY(0);
    bottom: 50px;
}
/* Curseur pointer pour bien montrer qu'on peut cliquer */
.clickable-card {
    cursor: pointer;
}
.clickable-card:active {
    transform: scale(0.98); /* Petit effet d'enfoncement au clic */
}

/* Permet à un élément de prendre toute la largeur dans une grid */
.full-width {
    grid-column: 1 / -1;
}

/* --- STYLE CARTE "GRIMOIRE" (Liquid Glass & Animé) --- */
.hero-card-glass {
    /* Fond transparent (Liquid Glass) */
    background: rgba(20, 15, 5, 0.3); 
    
    /* Le flou pour l'effet de verre */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Bordure subtile */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    
    /* Espacement interne pour faire "Grosse Carte" */
    padding: 3rem 4rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    
    /* PRÉPARATION DE L'ANIMATION */
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, border-color 0.4s;
    cursor: default; /* ou pointer si tu veux qu'on clique */
}

/* --- L'ANIMATION AU SURVOL (HOVER) --- */
.hero-card-glass:hover {
    /* La carte monte vers le haut */
    transform: translateY(-10px);
    
    /* Le fond devient un tout petit peu plus visible */
    background: rgba(20, 15, 5, 0.5);
    
    /* Une lueur dorée apparaît derrière */
    box-shadow: 0 20px 50px rgba(255, 215, 0, 0.15);
    
    /* La bordure devient dorée */
    border-color: var(--color-accent);
}

/* Le Titre */
.hero-card-glass h1 {
    font-family: var(--font-jdr);
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Le sous-texte */
.hero-card-glass p {
    font-family: var(--font-sober);
    color: #E0E0E0;
    font-size: 1.1rem;
}

/* --- CARTES HORIZONTALES (SECTION AIDES) --- */
.horizontal-card {
    display: flex;
    align-items: center; /* Centre verticalement */
    padding: 2rem;
    gap: 2rem; /* Espace entre le bouton et le texte */
    transition: transform 0.3s ease, background 0.3s ease;
}

.horizontal-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px); /* Petit mouvement vers la droite */
}

/* Zone du bouton (à gauche) */
.card-action {
    flex-shrink: 0; /* Empêche le bouton de rétrécir */
}

/* Zone du texte */
.card-content {
    text-align: left;
    flex: 1; /* Le texte prend toute la place dispo pour pousser le bouton à droite */
}

/* Mise à jour pour le mobile : Texte en haut, Bouton en bas */
@media (max-width: 768px) {
    .horizontal-card {
        flex-direction: column; /* On empile normalement */
        text-align: center;
    }
    .card-content {
        text-align: center;
        margin-bottom: 1.5rem; /* Un peu d'espace entre texte et bouton */
    }
}
/* --- BOUTON DÉSACTIVÉ (GRIS) --- */
.cta-button.disabled {
    background: #4a4a4a; /* Gris foncé */
    color: #888;         /* Texte gris clair */
    border: 1px solid #555;
    cursor: not-allowed; /* Curseur "interdit" */
    box-shadow: none;
    transform: none !important; /* Pas d'animation au clic/survol */
}

.cta-button.disabled:hover {
    background: #4a4a4a; /* Reste gris au survol */
    box-shadow: none;
    transform: none;
}

/* --- MOBILE (Responsive) --- */
@media (max-width: 768px) {
    .horizontal-card {
        flex-direction: column-reverse; /* Texte en haut, bouton en bas sur mobile */
        text-align: center;
    }
    .card-content {
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* --- STYLES DU BOUTON DISCORD --- */

.login-btn {
    /* Flexbox pour aligner parfaitement l'icône et le texte */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* Espace entre l'icône et le texte */

    /* Couleurs officielles de Discord */
    background-color: #5865F2; /* Le fameux "Blurple" */
    color: white !important; /* Force le texte en blanc */
    
    /* Typographie */
    text-decoration: none;
    font-family: 'Poppins', sans-serif; /* Utilise ta police principale */
    font-weight: 600; /* Un peu gras pour que ça ressorte */
    font-size: 1.1rem; /* Texte plus grand */

    /* Taille et espacement (fini le côté compact !) */
    padding: 12px 28px; /* Beaucoup plus d'espace interne */
    border-radius: 8px; /* Coins arrondis modernes */
    border: none;
    
    /* Effets visuels */
    cursor: pointer;
    transition: all 0.2s ease-in-out; /* Animation fluide au survol */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Légère ombre pour le relief */
}

/* Style de l'icône SVG à l'intérieur du bouton */
.discord-icon {
    width: 28px; /* Icône de bonne taille */
    height: 28px;
    fill: currentColor; /* L'icône prend la couleur du texte (blanc) */
}

/* --- EFFET AU SURVOL (HOVER) --- */
.login-btn:hover {
    background-color: #4752c4; /* Devient légèrement plus foncé */
    transform: translateY(-3px); /* Le bouton "saute" légèrement vers le haut */
    box-shadow: 0 6px 12px rgba(88, 101, 242, 0.3); /* L'ombre s'agrandit et prend la couleur Discord */
}

/* --- EFFET AU CLIC (ACTIVE) --- */
.login-btn:active {
    transform: translateY(-1px); /* Le bouton s'enfonce un peu */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}