/* ==========================================
   1. VARIABLES GLOBALES (Couleurs et tailles)
   ========================================== */
:root {
    --nature-vert: #4a7c44;
    --nature-clair: #f0f4f0;
    --nature-beige: #faf9f6;
    --nature-texte: #2d3436;
    --nature-fond: #f8faf8;
    --arrondi: 25px;
    --largeur-site: 1200px; /* Largeur validée pour tout le site */
}

/* ==========================================
   2. RESET ET FOND DE PAGE
   ========================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--nature-texte);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    
    /* Le fond est géré dynamiquement par PHP, mais on garde les réglages fixes ici */
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--nature-fond); /* Couleur de secours au chargement */
}

.site-container {
    width: 100%;
    max-width: var(--largeur-site);
}

.banner-img {
    width: 100%;
    height: auto;
    border-radius: var(--arrondi);
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--nature-vert); /* Ajout du contour vert */
}

.main-wrapper {
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.80); /* Opacité baissée ici à 85% */
    border-radius: var(--arrondi);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid var(--nature-vert);
}

h2 { text-align: center; color: var(--nature-vert); margin-top: 0; margin-bottom: 20px; }
h3 { color: var(--nature-vert); margin-top: 0; }

/* ==========================================
   3. NAVIGATION (MENU)
   ========================================== */
nav {
    margin: 20px auto;
    padding: 10px 40px;
    background: rgba(255, 255, 255, 0.80); /* Opacité baissée ici à 85% */
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: fit-content;
    backdrop-filter: blur(5px); /* Ce filtre floute légèrement ce qu'il y a derrière, c'est très esthétique avec la transparence */
    border: 1px solid var(--nature-vert);
}
/* ==========================================
   4. BOUTONS ET ALERTES
   ========================================== */
.btn-valider, .btn-admin-news, .btn-send {
    background: var(--nature-vert);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-valider:hover, .btn-admin-news:hover, .btn-send:hover {
    background: #3b6336;
}

.btn-annuler {
    background: #999;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}

.alert, .msg {
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}
.alert-success, .succes { background: #e1ede0; color: var(--nature-vert); border: 1px solid #c8e6c9; }
.alert-error, .erreur { background: #fee; color: #c33; border: 1px solid #fcc; }

/* ==========================================
   5. PAGE ACCUEIL (Onglets, Actualités, Blog)
   ========================================== */
.tabs-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--nature-clair); padding-bottom: 10px; margin-bottom: 20px; }
.tabs { display: flex; gap: 10px; }
.tab-btn { padding: 10px 25px; cursor: pointer; border: none; background: none; font-weight: bold; color: #999; border-radius: var(--arrondi); font-family: inherit; font-size: 1em; }
.tab-btn.active { background: var(--nature-vert); color: white; }
.user-badge { background: #e1ede0; padding: 8px 20px; border-radius: 30px; color: var(--nature-vert); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.content-scroll { max-height: 800px; overflow-y: auto; padding-right: 15px; }

/* Actualités & Blog items */
.news-item, .blog-bubble { background: var(--nature-beige); padding: 20px; border-radius: 20px; margin-bottom: 20px; border-left: 5px solid var(--nature-vert); position: relative; }
.blog-bubble { border-left-color: #8dae8a; }
.news-header, .blog-meta { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.news-date, .blog-meta span { font-size: 0.85em; color: #777; }

/* Galerie images */
.news-gallery { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.news-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 15px; cursor: pointer; border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* Formulaire Blog */
.blog-form { background: var(--nature-clair); padding: 20px; border-radius: 20px; margin-bottom: 30px; }
.blog-form textarea { width: 100%; border: 2px solid #fff; border-radius: 15px; padding: 15px; box-sizing: border-box; resize: none; margin-bottom: 10px; font-family: inherit; }

/* Commentaires */
.comments-section { margin-top: 15px; padding-left: 20px; border-left: 2px solid #ddd; }
.comment-item { font-size: 0.9em; background: white; padding: 10px; border-radius: 15px; margin-top: 8px; border: 1px solid #eee; }
.comment-form { margin-top: 15px; display: flex; gap: 10px; }
.comment-form input { flex: 1; border: 1px solid #ddd; border-radius: 15px; padding: 8px 15px; font-family: inherit; }
.btn-com { background: #8dae8a; color: white; border: none; padding: 5px 15px; border-radius: 15px; cursor: pointer; }

/* Actions (Modifier / Supprimer) */
.action-group { display: flex; gap: 8px; }
.btn-action { border: none; padding: 5px 12px; border-radius: 10px; cursor: pointer; font-size: 0.8em; font-weight: bold; font-family: inherit; }
.btn-edit { background: #e1ede0; color: var(--nature-vert); }
.btn-delete { background: #fee; color: #c33; }

/* ==========================================
   6. FENÊTRES FLOTTANTES (MODALS) ET LIGHTBOX
   ========================================== */
.modal { display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); align-items: center; justify-content: center; }
.modal-content { background: white; padding: 30px; border-radius: var(--arrondi); width: 95%; max-width: 500px; box-shadow: 0 20px 50px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.modal-content input, .modal-content textarea { width: 100%; padding: 12px; margin: 10px 0; border: 2px solid var(--nature-clair); border-radius: 15px; box-sizing: border-box; font-family: inherit; }

.lightbox-modal { display: none; position: fixed; z-index: 4000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.lightbox-img { max-width: 90%; max-height: 90%; border-radius: 15px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 40px; cursor: pointer; }

/* ==========================================
   7. PAGE DÉCHETS (Grilles et cartes)
   ========================================== */
.dechets-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.card-poubelle { padding: 25px; border-radius: 20px; text-align: center; border: 2px solid transparent; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.card-large { grid-column: span 3; } 
.card-small { grid-column: span 2; } 
.dates-list { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; }
.date-row { background: white; padding: 10px; border-radius: 12px; font-weight: bold; font-size: 1em; box-shadow: 0 2px 4px rgba(0,0,0,0.03); border-left: 5px solid transparent; }
.btn-edit-corner { position: absolute; top: 10px; right: 10px; background: white; border: 1px solid #ddd; padding: 5px 10px; border-radius: 12px; cursor: pointer; font-size: 0.75em; }

/* Thèmes Poubelles */
.card-1 { background: #f1f8f1; border-color: #4a7c44; } .card-1 .date-row { border-left-color: #4a7c44; color: #4a7c44; }
.card-2 { background: #fffde7; border-color: #fbc02d; } .card-2 .date-row { border-left-color: #fbc02d; color: #f57f17; }
.card-3 { background: #fdfbf7; border-color: #8d6e63; } .card-3 .date-row { border-left-color: #8d6e63; color: #5d4037; }
.card-4 { background: #f1fcf1; border-color: #8bc34a; }
.card-5 { background: #f3f7fd; border-color: #2196f3; }

/* ==========================================
   8. PAGE INFOS PRATIQUES
   ========================================== */
.infos-grid { display: flex; gap: 30px; flex-wrap: wrap; }
.info-card { flex: 1; min-width: 300px; background: #fdfbf7; padding: 30px; border-radius: 20px; border: 2px solid #eee; position: relative; }
.contact-item { margin-bottom: 20px; }
.contact-item strong { display: block; color: #777; font-size: 0.9em; text-transform: uppercase; }
.contact-item p { margin: 5px 0; font-size: 1.1em; font-weight: 500; }
.horaires-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.horaires-table td { padding: 12px 0; border-bottom: 1px solid #eee; }
.horaires-table td:first-child { font-weight: bold; color: #555; }
.horaires-table td:last-child { text-align: right; color: var(--nature-vert); font-weight: bold; }

/* ==========================================
   9. RESPONSIVE (Tablettes et Mobiles)
   ========================================== */
@media (max-width: 900px) {
    .card-large, .card-small { grid-column: span 6; }
    .infos-grid { flex-direction: column; }
}

@media (max-width: 768px) {
    .form-row { flex-direction: column; }
}