/* =====================================================================
   0. CONFIGURATION ET VARIABLES GENERALES
   ===================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a1a1a;
    --secondary: #333;
    --accent: #ff6b35; /* Orange VTT / Sport */
    --light: #f5f5f5;
    --white: #ffffff;
    --border: #333333; /* Assombri pour un thème plus immersif */
}

html {
    scroll-behavior: smooth; /* Défilement fluide natif */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #121212; /* Fond sombre idéal pour faire ressortir les photos */
    color: #e0e0e0;
    line-height: 1.6;
}

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

main {
    padding: 2rem 0;
}

/* =====================================================================
   1. ENTÊTE FIXE (HEADER & STICKY NAVIGATION)
   ===================================================================== */
header {
    background: #000000;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--white);
    text-decoration: none;
}

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

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

nav a:hover {
    color: var(--accent);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}
/* =========================
   NAVBAR
========================= */

.navbar {
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .hamburger {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 60px;
        right: 0;

        flex-direction: column;
        align-items: flex-start;

        background: #111;
        width: 220px;

        padding: 20px;

        border-radius: 12px;

        display: none;

        box-shadow: 0 10px 30px rgba(0,0,0,0.3);

        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        width: 100%;
        display: block;
        padding: 10px 0;
    }

    .coffee-btn {
        margin-top: 10px;
    }
}
/* =====================================================================
   2. CORRECTION DU DEFILEMENT (One-Page Fix)
   ===================================================================== */
/* Laisse un espace vide au-dessus de la section visée lors du clic pour ne pas cacher le titre sous le menu */
.section-unique, #events {
    scroll-margin-top: 250px; 
}

.section-unique {
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =====================================================================
   3. HERO BANNER
   ===================================================================== */
.hero {
    background: linear-gradient(135deg, #000000 0%, var(--primary) 100%);
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto 1.5rem auto;
}

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

/* Titles placeholders */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    color: var(--white);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
}

/* =====================================================================
   4. GRILLE DES ÉVÉNEMENTS (Cards)
   ===================================================================== */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.event-card {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.event-card:hover {
    box-shadow: 0 12px 24px rgba(0,0,0,0.5);
    transform: translateY(-8px);
    border-color: var(--accent);
}

.event-thumbnail {
    width: 100%;
    height: 220px;
    background: #252525;
    overflow: hidden;
    position: relative;
}

.event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.event-card:hover .event-thumbnail img {
    transform: scale(1.08);
}

.event-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252525;
    color: #555;
    font-size: 3rem;
}

.event-info {
    padding: 1.5rem;
}

.event-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: var(--white);
}

.event-description {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #777;
}

.event-photos-count {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

/* =====================================================================
   5. VUE GALERIE ET GRILLE MASONRY (Mosaïque)
   ===================================================================== */
.gallery-view {
    display: none;
}

.gallery-view.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.gallery-back {
    background: #1e1e1e;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--white);
    transition: all 0.3s;
}

.gallery-back:hover {
    color: var(--white);
    background: var(--accent);
    border-color: var(--accent);
}

.gallery-title {
    flex: 1;
    text-align: center;
}

.gallery-title h2 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 0.3rem;
}

.gallery-title p {
    color: #aaa;
    font-size: 0.95rem;
}

.masonry {
    column-count: 4;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #1e1e1e;
    transition: all 0.3s;
}

.masonry-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transform: scale(1.02);
}

  .masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s;
}

.masonry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.masonry-overlay i {
    color: var(--white);
    font-size: 2rem;
}

/* =====================================================================
   6. SECTIONS D'APPOINT (About & Contact Form)
   ===================================================================== */
.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.about-text p {
    margin-bottom: 15px;
    color: #ccc;
}

.contact-grid {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-form {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 14px;
    background: #1e1e1e;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.contact-form button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    align-self: flex-start;
    transition: background 0.2s;
}

.contact-form button:hover {
    background: #e65c2b;
}

.contact-info {
    flex: 1;
    min-width: 250px;
    background: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    height: fit-content;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-item i {
    color: var(--accent);
    font-size: 1.3rem;
    width: 25px;
    text-align: center;
}

/* =====================================================================
   7. LIGHTBOX CONTROLS
   ===================================================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: var(--white);
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox-nav:hover {
    opacity: 1;
    background: var(--accent);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

/* =====================================================================
   8. FOOTER & COMPOSANTS SQUELETTES (Loader)
   ===================================================================== */
footer {
    background: #000000;
    color: var(--white);
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid var(--border);
}

footer p {
    opacity: 0.8;
}

.loader {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #222;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-events {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-events i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* =====================================================================
   9. MEDIA QUERIES (MEDIA SIZES ET RESPONSIVE)
   ===================================================================== */
@media (max-width: 1024px) {
    .masonry {
        column-count: 3;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

@media (max-width: 768px) {
    .masonry {
        column-count: 2;
    }
    nav ul {
        gap: 1.2rem;
    }
    .hero h1 {
        font-size: 2.3rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .about-content, .contact-grid {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .masonry {
        column-count: 1;
    }
    /* Sur petits écrans, on garde le bouton BuyMeACoffee et simplifie */
    nav ul li:not(:last-child) {
        display: none; 
    }
    .hero {
        padding: 3rem 0;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* =====================================================================
   10. AJOUTS DYNAMIQUES (MENU DÉROULANT, ADMIN & RECHERCHE PLAQUE)
   ===================================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1a1a1a;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 200;
    border-radius: 6px;
    border: 1px solid var(--border);
    top: 100%;
    left: 0;
    overflow: hidden;
}

.dropdown-content a {
    color: var(--light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--accent);
    color: var(--white);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Zone Recherche Plaque */
.search-container {
    max-width: 500px;
    margin: 0 auto 3rem auto;
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    background: #1e1e1e;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 30px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.search-btn {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 0 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #e65c2b;
}

/* Interface Zone Administration */
.admin-box {
    max-width: 650px;
    margin: 40px auto;
    padding: 30px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-form label {
    font-weight: 600;
    color: var(--white);
    margin-bottom: -10px;
}

.admin-form input[type="text"],
.admin-form input[type="date"],
.admin-form input[type="file"] {
    width: 100%;
    padding: 12px;
    background: #121212;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
}

.admin-form button {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-form button:hover {
    background: #e65c2b;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.alert-error { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }

@media (max-width: 768px) {
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding-left: 15px;
    }
    .nav-menu.active .dropdown-content {
        display: block;
    }
}