/* =========================================
   VARIABLES "SPORT ELITE" (Couleurs plus intenses)
   ========================================= */
:root {
    --primary: #1e3a8a;    /* Bleu Nuit très profond et sportif */
    --secondary: #2563eb;  /* Bleu Athlétique vif */
    --accent: #f59e0b;     /* Jaune Or intense (Énergie) */
    --success: #16a34a;
    --danger: #dc2626;
    --light: #f8fafc;
    --dark: #0f172a;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* =========================================
   1. STYLE DU SITE PUBLIC (FRONT-OFFICE)
   ========================================= */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Menu de navigation public */
.public-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.public-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

.public-logo {
    font-size: 26px;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.public-logo span {
    color: var(--secondary);
}

.public-menu {
    display: flex;
    align-items: center; 
    gap: 30px; 
}

.public-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    transition: color 0.3s;
    white-space: nowrap; /* EMPÊCHE LE TEXTE DE PASSER À LA LIGNE */
}

.public-menu a:hover {
    color: var(--secondary);
}

/* On cache le bouton mobile par défaut sur ordinateur */
.mobile-menu-btn {
    display: none; 
}

/* =========================================
   MENU DÉROULANT ORDINATEUR (HOVER)
   ========================================= */
.dropdown {
    position: relative;
    display: inline-block;
    white-space: nowrap; /* S'assure que "Le Club ▾" reste sur une ligne */
}

/* Force les boutons de profil/déconnexion à rester côte à côte sur PC */
.auth-buttons {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 15px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 10000;
    top: 100%;
    left: 0;
    border-radius: 8px;
    overflow: hidden;
    flex-direction: column;
}

.dropdown-content a {
    color: var(--dark);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    text-transform: none; /* Annule les majuscules */
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f8fafc;
    color: var(--secondary);
    padding-left: 25px; /* Petit effet de glissement */
}

/* Affichage du sous-menu au survol (Uniquement sur PC) */
.dropdown:hover .dropdown-content {
    display: flex;
}

/* =========================================
   CLASSES STRUCTURELLES & SECTIONS
   ========================================= */
.section-padding { padding: 80px 0; }

.section-title {
    text-align: center;
    margin-bottom: 50px;
    text-transform: uppercase;
    font-weight: 900;
    font-size: 2.5rem;
    position: relative;
    color: var(--primary);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 5px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 3px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-5px); }
.card-body { padding: 25px; }

/* Sections Hero Dynamiques */
.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white); 
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    z-index: -2; 
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,23,42,0.4), rgba(15,23,42,0.8));
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 850px;
    padding: 20px;
}

.hero-content h1 {
    font-size: 4em; 
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.3em;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}

/* Statistiques & Chiffres */
.stats-bar {
    background: var(--primary);
    color: var(--white);
    padding: 60px 0;
}

.stat-item { text-align: center; }

.stat-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--accent);
}

/* Cartes des événements */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.events-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 40px 0;
}

.event-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    flex: 1 1 calc(33.333% - 20px); 
    min-width: 250px;
    border-top: 5px solid var(--secondary);
}

.public-footer {
    background-color: var(--primary);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

/* BOUTONS GLOBAUX */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background-color: var(--secondary); }
.btn-primary:hover { background-color: #1d4ed8; }
.btn-success { background-color: var(--success); }
.btn-warning { background-color: var(--accent); color: var(--dark); }
.btn-danger { background-color: var(--danger); }
.btn-accent { background: var(--accent); color: var(--dark); font-size: 1.1rem; padding: 15px 30px; border-radius: 30px; }
.btn-accent:hover { background: #d97706; color: white; }

/* =========================================
   2. STYLE DU DASHBOARD ADMINISTRATEUR
   ========================================= */
.admin-body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--light);
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background-color: #0f172a; 
    color: #f8fafc;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-logo {
    padding: 25px 20px;
    text-align: center;
    background-color: #1e293b;
    border-bottom: 1px solid #334155;
}

.admin-sidebar-logo h2 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    padding-top: 15px;
}

.admin-nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 15px 20px;
    font-size: 15px;
    border-left: 4px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.admin-nav-link:hover {
    background-color: #1e293b;
    color: var(--secondary);
    border-left-color: var(--secondary);
}

.text-danger { color: #ef4444 !important; }

.admin-main {
    display: flex;
    flex-direction: column;
    overflow-x: hidden; 
}

.admin-topbar {
    background-color: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    justify-content: flex-end;
}

.admin-content-area { padding: 30px; }

.dashboard-cards {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    flex: 1;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #64748b;
    font-size: 15px;
    text-transform: uppercase;
}

.stat-number {
    margin: 0;
    font-size: 36px;
    font-weight: bold;
    color: #0f172a;
}

.builder-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 100%;
}

.builder-form .form-group label {
    color: #1e293b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   3. STYLE DES TABLEAUX ADMIN
   ========================================= */
.admin-header-page {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 15px;
}

.admin-header-page h2 {
    color: #0f172a;
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table th {
    background-color: #0f172a;
    color: white;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.admin-table tr:hover { background-color: #f8fafc; }

.action-buttons {
    display: flex;
    gap: 5px;
}

/* =========================================
   4. MODULES PUBLICS (ACTUALITÉS & GALERIE)
   ========================================= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.news-card:hover { transform: translateY(-5px); }

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #ecf0f1;
}

.news-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.news-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: var(--primary);
}

.news-body {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 280px; 
    gap: 25px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    background: #111; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    z-index: 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85; 
    transition: transform 0.6s ease, opacity 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
    opacity: 1;
}

/* =========================================
   5. CHATBOT IA GROQ FLOTTANT
   ========================================= */
.chatbot-toggler {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10001; 
    transition: transform 0.3s;
}

.chatbot-toggler:hover { transform: scale(1.1); background: var(--dark); }

.chatbot-window {
    position: fixed !important;
    bottom: 100px !important;
    right: 30px !important;
    left: auto !important;
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none; 
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    border: 1px solid #ecf0f1;
}

.chatbot-window.active {
    display: flex !important;
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 15px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close { background: none; border: none; color: white; font-size: 20px; cursor: pointer; }

.chat-body {
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    background: var(--light);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.bot { background: #e2e8f0; color: var(--dark); align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-message.user { background: var(--secondary); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }

.chat-footer {
    display: flex;
    padding: 10px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    padding: 10px 15px;
    border-radius: 20px;
    background: var(--light);
    outline: none;
}

.chat-send { background: var(--primary); color: white; border: none; padding: 10px 15px; margin-left: 10px; border-radius: 20px; cursor: pointer; }

/* =========================================
   ESPACE CLIENT & CONNEXION ADMIN (FORMULAIRES)
   ========================================= */

/* Sécurité anti-spam : on cache le champ miel */
.champ-miel { 
    display: none !important; 
}

/* Centrage vertical pour la page login admin */
.setup-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--light);
    margin: 0;
}

/* Boîtes blanches pour les formulaires */
.setup-container, .client-auth-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
}

/* Style des champs de saisie */
.setup-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.setup-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 600;
    font-size: 14px;
}

.setup-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 15px;
    transition: border-color 0.3s;
}

.setup-form input:focus {
    border-color: var(--secondary);
    outline: none;
}

.text-center { 
    text-align: center; 
}
/* =========================================
   6. RESPONSIVE DESIGN (MOBILE FIRST)
   ========================================= */

@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.8rem; }
    
    /* BOUTON BURGER */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }

    .mobile-menu-btn span {
        width: 100%;
        height: 3px;
        background-color: var(--primary);
        border-radius: 10px;
        transition: all 0.3s;
    }

    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* MENU MOBILE GLISSANT */
    .public-menu {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 80%;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        box-shadow: -10px 0 20px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.77,0,0.175,1);
        z-index: 1000;
        display: flex !important; /* Force l'affichage pour le glissement */
    }

    .public-menu.active {
        right: 0; 
    }

    /* ACCORDÉON MOBILE POUR "LE CLUB" */
    .dropdown {
        width: 100%;
        text-align: center;
    }
    
    /* On annule le survol sur mobile */
    .dropdown:hover .dropdown-content {
        display: none; 
    }
    
    .dropdown-content {
        position: relative; 
        top: 0;
        width: 100%;
        box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
        background-color: #f1f5f9;
        margin-top: 10px;
        display: none; /* Fermé par défaut */
    }

    /* Déclenché par JavaScript */
    .dropdown-content.active {
        display: flex !important;
    }

    .auth-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 40px;
        gap: 15px;
    }

    .auth-buttons .btn { width: 100%; text-align: center; }
}

/* BOUTON BURGER ADMIN (Caché sur PC) */
.admin-mobile-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.admin-mobile-btn span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

/* RESPONSIVE ADMIN (< 768px) */
@media (max-width: 768px) {
    .admin-layout { display: flex; flex-direction: column; }
    .admin-sidebar { width: 100%; min-height: auto; }
    .admin-sidebar-logo { padding: 15px 20px; }
    .admin-mobile-btn { display: flex; }
    .admin-nav { display: none; flex-direction: column; padding-top: 0; background-color: #0f172a; }
    .admin-nav.active { display: flex; }
    .admin-nav-link { padding: 15px 20px; font-size: 14px; border-left: none; border-bottom: 1px solid #1e293b; }
    .admin-topbar { justify-content: center; padding: 10px; font-size: 12px; background: #f1f5f9; box-shadow: none; border-bottom: 1px solid #cbd5e1; }
    .admin-content-area { padding: 15px; width: 100%; max-width: 100vw; overflow-x: hidden; }
    .admin-header-page { flex-direction: column; align-items: stretch; gap: 15px; text-align: center; border-bottom: none; margin-bottom: 15px; }
    .admin-header-page .btn { width: 100%; text-align: center; padding: 12px; font-size: 16px; }
    .admin-table { display: block; width: 98%; margin: 0 auto; overflow-x: auto; white-space: nowrap; border-radius: 8px; }
    .admin-table th, .admin-table td { padding: 15px; }
    .dashboard-cards { flex-direction: column; gap: 15px; margin-top: 10px; }
}

/* Petits écrans (< 600px) */
@media (max-width: 600px) {
    .container { padding: 0 15px; }
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 250px; }
    .event-card { flex: 1 1 100%; }
    .dashboard-cards { flex-direction: column; }
    .chatbot-window { width: calc(100% - 40px); right: 20px !important; }
}