/* ==========================================================================
   BASES & TYPOGRAPHIE
   ========================================================================== */
body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #f4f7f6;
    color: #333333;
    margin: 0;
    padding: 0 0 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1, h2, h3 {
    color: #1e293b;
    margin-top: 0;
}

h1 {
    font-size: 1.6rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.3rem;
}

/* ==========================================================================
   EN-TÊTE (HEADER)
   ========================================================================== */
.top-branding {
    width: 95%;
    max-width: 1000px;
    margin: 2rem auto 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    box-sizing: border-box;
    background-color: #8fb392;
    padding: 1rem 2rem; /* Permet au fond vert de bien encadrer le contenu */
    border-radius: 8px; /* Pour l'esthétique */
}

.top-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
}

.top-title {
    font-size: 3rem;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    text-align: left;
}

@media (max-width: 768px) {
    .top-branding {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        margin-top: 1rem;
        padding: 1rem;
    }
    
    .top-logo {
        max-width: 160px;
    }
    
    .top-title {
        font-size: 2.2rem;
        text-align: center;
    }
}

/* ==========================================================================
   CONTENEUR PRINCIPAL & PAGE PUBLIQUE
   ========================================================================== */
.container {
    background-color: #ffffff;
    max-width: 1000px;
    width: 95%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 2rem;
}

.grid-events {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.event-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    border: 1px solid #e2e8f0;
}

.event-image {
    width: 35%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.event-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 65%;
}

.event-content h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.event-date { color: #0284c7; font-weight: bold; margin-bottom: 0.5rem; }
.event-format, .event-location { color: #475569; margin-bottom: 0.5rem; font-size: 0.95rem; }

@media (max-width: 768px) {
    .event-card { flex-direction: column; }
    .event-image, .event-content { width: 100%; }
}

/* Détail de l'événement (detail.php) */
.info-section { flex: 1 1 550px; padding: 2.5rem; box-sizing: border-box; }
.form-section { flex: 1 1 350px; padding: 2.5rem; background-color: #f8fafc; border-left: 1px solid #e2e8f0; box-sizing: border-box; }
.hero-image { width: 100%; height: auto; border-radius: 6px; margin: 1.5rem 0; display: block; }
.date { font-weight: 700; color: #0284c7; font-size: 1.1rem; margin-bottom: 1.5rem; }
.description p, .description li { line-height: 1.6; font-size: 1rem; color: #475569; }
.description ul { padding-left: 1.5rem; margin: 1rem 0; }

/* ==========================================================================
   FORMULAIRES (Partagé Public & Admin)
   ========================================================================== */
.form-group { margin-bottom: 1.2rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #334155; font-size: 0.95rem; }

/* On ne cible plus "textarea" ici pour ne pas perturber TinyMCE */
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="datetime-local"], select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #0284c7;
}

/* Style de base pour un textarea sans éditeur */
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 100px;
}

.submit-btn, .btn-access {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    width: 100%;
    padding: 1rem;
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.submit-btn:hover, .btn-access:hover { background-color: #0369a1; }
.disclaimer { font-size: 0.8rem; color: #64748b; margin-top: 1.5rem; text-align: center; line-height: 1.4; }
.hidden { display: none !important; }
.honeypot { display: none !important; }

#confirmation-message { text-align: center; padding: 3rem 0; }
#confirmation-message p { color: #15803d; font-size: 1.1rem; font-weight: 600; line-height: 1.5; margin-bottom: 0.5rem; }

/* ==========================================================================
   ADMINISTRATION
   ========================================================================== */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #f4f7f6; margin: 0; }
.login-box { background: white; padding: 2.5rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: center; width: 100%; max-width: 400px; }

.admin-container { max-width: 1200px; width: 95%; margin: 0 auto; padding: 2rem 0; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-header h2 { margin: 0; flex: 1 1 50%; min-width: 300px; }
.admin-header > div { display: flex; gap: 1rem; flex-wrap: wrap; }

.form-panel {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.file-input { margin-bottom: 0.5rem; }
.image-preview { margin-top: 1rem; }
.image-preview img { width: 100px; height: 100px; object-fit: cover; border-radius: 4px; }
.cancel-link { text-align: center; margin-top: 1rem; }
.cancel-link a { color: #64748b; text-decoration: none; }

/* Tableaux d'administration */
.list-panel table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    table-layout: fixed;
    border-radius: 8px;
    overflow: hidden;
}

.list-panel th, .list-panel td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.list-panel td:nth-child(2) {
    width: 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* La colonne des boutons actions : on force à rester sur une ligne */
.list-panel td:last-child {
    white-space: nowrap;
    width: 1%;
}

/* Boutons d'administration */
.btn-small {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem;
    border-radius: 4px;
    text-decoration: none;
    color: #ffffff !important; /* Force la couleur blanche, empêche les conflits de sélection */
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.btn-inscrits { background-color: #3b82f6; }
.btn-edit { background-color: #f59e0b; }
.btn-delete { background-color: #ef4444; }

.btn-logout, .btn-retour {
    background-color: #64748b;
    text-decoration: none;
    padding: 0.6rem 1rem;
    color: white;
    border-radius: 4px;
    display: inline-block;
}

.btn-rappel {
    background-color: #10b981;
    text-decoration: none;
    padding: 0.6rem 1rem;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    display: inline-block;
}

/* Notifications */
.message-succes {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}