/* ==========================================================================
   1. VARIABLES GLOBALES & RESET
   ========================================================================== */
:root {
    --bg-color: #0f1115;
    --card-bg: #181b21;
    --accent-color: #ff3366;
    --accent-hover: #e02855;
    --text-primary: #f0f2f5;
    --text-secondary: #a0aec0;
    --border-color: #2a2e39;
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* ==========================================================================
   2. BARRE DE NAVIGATION (NAVBAR)
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(24, 27, 33, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav-tabs {
    display: flex;
    gap: 10px;
}

/* Style des boutons de menu non-actifs */
.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #d1d5db;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Style du menu actif */
.nav-btn.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.35);
}

/* ==========================================================================
   3. CARTES ET CONTENU GÉNÉRAL
   ========================================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.accent {
    color: var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. SECTION PRÉSENTATION & RÉUNION
   ========================================================================== */
.hero {
    text-align: center;
    margin: 2rem 0 2.5rem;
}

.hero .tag {
    background: rgba(255, 51, 102, 0.15);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0.8rem 0;
    line-height: 1.2;
}

.hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 650px;
    margin: 0 auto;
}

/* Encart d'information : Réunion hebdomadaire */
.meeting-banner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.3);
    padding: 1.5rem 2rem;
}

.meeting-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.meeting-info h3 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 0.3rem;
}

.meeting-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.4;
}

.meeting-info strong {
    color: var(--accent-color);
}

.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.feature-card .icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ==========================================================================
   5. TITRES DE SECTION & GRILLE D'ÉVÉNEMENTS
   ========================================================================== */
.section-title {
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 800;
}

.section-title p {
    color: var(--text-secondary);
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-date {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
    width: fit-content;
}

.event-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.event-desc {
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   6. GALERIE & FILTRES
   ========================================================================== */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 1.8rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    color: #ffffff;
    font-size: 1rem;
}

.gallery-overlay p {
    color: #cccccc;
    font-size: 0.85rem;
}

.gallery-overlay .exif {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-top: 4px;
}

/* ==========================================================================
   7. FORMULAIRES & BOUTONS
   ========================================================================== */
.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
}

.form-group input, .form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem; /* 1rem pour éviter le zoom automatique sur iOS */
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn-primary {
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 48px;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.form-response {
    display: none;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.form-response.success {
    background: rgba(0, 200, 81, 0.15);
    color: #00e676;
    border: 1px solid #00c851;
}

.form-response.error {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
    border: 1px solid #ff3366;
}

/* ==========================================================================
   8. LIGHTBOX & FOOTER
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1rem;
}

.lightbox-content {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-caption {
    margin-top: 1rem;
    color: #ffffff;
    font-size: 1rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    color: #ffffff;
    cursor: pointer;
    padding: 10px;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==========================================================================
   9. MEDIA QUERIES (ADAPTATION MOBILES ET TABLETTES)
   ========================================================================== */

/* Tablettes & Smartphones (Largeur max: 768px) */
@media (max-width: 768px) {
    
    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }

    .logo {
        justify-content: center;
    }

    /* Barre de navigation horizontale défilante pour mobile */
    .nav-tabs {
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none; /* Cache la barre de scroll disgracieuse */
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 0.88rem;
        flex-shrink: 0;
    }

    .container {
        padding: 1.2rem 1rem;
    }

    .hero {
        margin: 1rem 0 2rem;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .hero .subtitle {
        font-size: 0.95rem;
    }

    /* Encart de réunion réorganisé verticalement */
    .meeting-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem 1rem;
        gap: 0.8rem;
    }

    .meeting-icon {
        font-size: 2.2rem;
    }

    .section-title h2 {
        font-size: 1.6rem;
    }

    /* Grille de la galerie sur mobile (2 colonnes) */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    /* Overlay toujours visible sur mobile (pas besoin d'un hover) */
    .gallery-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.9), transparent 80%);
        padding: 0.6rem;
    }

    .gallery-overlay h4 {
        font-size: 0.85rem;
    }

    .gallery-overlay p {
        font-size: 0.75rem;
    }

    .gallery-overlay .exif {
        display: none; /* Masquer les EXIF sur petit écran pour alléger */
    }

    /* Tableaux admin avec scroll horizontal sur mobile */
    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 600px;
    }
}

/* Petits Smartphones (Largeur max: 480px) */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr; /* 1 photo par ligne sur très petit écran */
    }

    .filter-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
    }

    .filter-btn {
        flex-shrink: 0;
    }
}
