/* --- Styles de base pour l'application --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    display: flex;
    min-height: 100vh; /* S'assure que le conteneur prend toute la hauteur de la vue */
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #2c3e50; /* Couleur sombre pour la sidebar */
    color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease; /* Animation pour le menu hamburger */
}

.sidebar.collapsed {
    width: 80px; /* Largeur réduite quand repliée */
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #ecf0f1;
    font-size: 1.4em;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav ul li {
    margin-bottom: 10px;
}

.sidebar nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar nav ul li a i {
    font-size: 1.2em;
}

.sidebar nav ul li a span {
    display: inline-block; /* Pour masquer/afficher le texte */
    transition: opacity 0.3s ease;
}

.sidebar.collapsed nav ul li a span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background-color: #34495e; /* Couleur au survol ou actif */
}

/* Main Content Area */
.content {
    flex-grow: 1; /* Prend l'espace restant */
    padding: 20px;
}

.navbar {
    background-color: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-radius: 8px;
}

.navbar h1 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
    flex-grow: 1;
    text-align: center;
}

.hamburger-menu {
    font-size: 1.5em;
    cursor: pointer;
    color: #555;
    margin-right: 15px;
}

.main-content-area {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --- Styles pour les Rapports (déplacés depuis le script PHP) --- */

/* Styles pour les titres des sections de rapports */
.main-content-area h2 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Styles pour les tableaux */
.presence-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.presence-table th, .presence-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.presence-table th {
    background-color: #4CAF50; /* Vert pour l'en-tête du tableau */
    color: white;
    font-weight: bold;
}

.presence-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.presence-table tr:hover {
    background-color: #f1f1f1;
}

/* Styles spécifiques pour les observations de texte */
.red-text {
    color: red;
    font-weight: bold;
}

.darkred-text {
    color: darkred;
    font-weight: bold;
}

/* Styles pour les notes et messages */
.note {
    font-size: 0.9em;
    color: #555;
    margin-top: 20px;
    padding: 10px; /* Ajouté pour donner de l'espace */
    border-left: 5px solid #ccc; /* Bordure indicative */
    background-color: #f8f8f8; /* Légèrement coloré */
    border-radius: 4px;
}
.note strong {
    color: #333; /* Rendre le texte en gras plus visible */
}

/* Messages d'erreur */
.error-message {
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
}

/* Messages d'absence de données */
.no-data-message {
    text-align: center;
    color: #777;
    padding: 15px;
    border: 1px dashed #ccc;
    margin-top: 20px;
    border-radius: 4px;
    background-color: #fdfdfd;
}

/* Styles pour le formulaire d'upload */
.upload-form {
    text-align: center;
    padding: 30px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    margin-top: 30px;
    background-color: #fdfdfd;
}

.upload-form label {
    display: block;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #333;
}

.upload-form input[type="file"] {
    margin-bottom: 20px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fdfdfd;
    width: fit-content; /* S'ajuste au contenu */
    display: inline-block; /* Pour centrer si besoin */
}

.upload-form button[type="submit"] {
    background-color: #5cb85c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.upload-form button[type="submit"]:hover {
    background-color: #4cae4c;
}

/* Espacement entre les sections de rapports */
.section-title {
    margin-top: 40px;
    margin-bottom: 20px;
}

/* Styles pour le conteneur principal des rapports mensuels */
.reports-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Espace entre les mois */
    justify-content: center; /* Centre les sections de mois */
}

.month-section {
    flex: 1 1 calc(33% - 40px); /* 3 colonnes, ajustez le 33% et 40px (gap*2) si le gap change */
    min-width: 280px; /* Largeur minimale pour éviter un écrasement sur petits écrans */
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.month-section h3 {
    text-align: center;
    color: #34495e;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.report-item:last-child {
    border-bottom: none; /* Pas de bordure pour le dernier élément */
}

.report-item span {
    font-size: 0.95em;
    color: #555;
    flex-grow: 1; /* Permet au texte de prendre de la place */
}

.report-item .button {
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-left: 8px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.report-item .button:hover {
    transform: translateY(-1px);
}

.absences-button {
    background-color: #d9534f; /* Rouge pour les absences */
    color: white;
}

.absences-button:hover {
    background-color: #c9302c;
}

.presences-button {
    background-color: #5bc0de; /* Bleu pour les présences/résumé */
    color: white;
}

.presences-button:hover {
    background-color: #31b0d5;
}

/* Media Queries pour la responsivité */
@media (max-width: 768px) {
    .month-section {
        flex: 1 1 calc(50% - 20px); /* 2 colonnes sur les tablettes */
    }
}

@media (max-width: 480px) {
    .month-section {
        flex: 1 1 100%; /* 1 colonne sur les petits mobiles */
    }
    .report-item {
        flex-direction: column; /* Empile les éléments sur les petits écrans */
        align-items: flex-start;
        gap: 5px;
    }
    .report-item .button {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 5px;
    }
}