/* ====================
   Variables et polices
   ==================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
    --couleur-primaire: #4CAF50; /* Vert foncé */
    --couleur-secondaire: #45a049; /* Vert plus clair */
	--couleur-trois:#F30C4A; /* Rouge */
    --couleur-texte: #333; /* Gris foncé pour le texte */
    --couleur-fond-clair: #f4f4f4; /* Fond gris très clair */
    --couleur-bordure: #ddd; /* Gris clair pour les bordures */
    --radius-bouton: 8px;
    --taille-police-bouton: 1.2rem;
}

/* ====================
   Styles généraux
   ==================== */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--couleur-fond-clair);
    color: var(--couleur-texte);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* Conteneur principal et responsivité */
.container {
    max-width: 900px; /* Augmente la largeur max pour les grands écrans */
    width: 90%; /* S'adapte à 90% de la largeur de la vue */
	margin: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* Inclusion du padding et de la bordure dans la largeur */
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .container {
        width: 100%;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Titres et liens */
h1, h2, h3 {
    color: var(--couleur-primaire);
    text-align: center;
    font-weight: 700;
}

h2 {
    margin-top: 30px;
}

a {
    color: var(--couleur-primaire);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ====================
   Formulaires
   ==================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--radius-bouton);
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus,
select:focus {
    border-color: var(--couleur-primaire);
    outline: none;
}

/* ====================
   Boutons
   ==================== */
button,
.btn-accueil {
    width: 100%;
    padding: 15px 20px;
    font-size: var(--taille-police-bouton);
    font-weight: 700;
    color: #fff;
    background-color: var(--couleur-primaire);
    border: none;
    border-radius: var(--radius-bouton);
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
}

button:hover,
.btn-accueil:hover {
    background-color: var(--couleur-secondaire);
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.button-group a {
    flex-grow: 1;
    min-width: 250px;
}

.btn-accueil {
    padding: 25px;
    font-size: 1.5rem;
    text-decoration: none;
    display: block;
}

.btn-saisie {
    background-color: var(--couleur-primaire);
}
.btn-defis {
    background-color: #007bff;
}
.btn-defis:hover {
    background-color: #0056b3;
}
.modify-btn, .modify-btn-defi, .modify-btn-equipe {
    background-color: #ffc107;
    color: var(--couleur-texte);
}
.modify-btn:hover, .modify-btn-defi:hover, .modify-btn-equipe:hover {
    background-color: #e0a800;
}
.delete-btn {
    background-color: #dc3545;
}
.delete-btn:hover {
    background-color: #c82333;
}
.consult-btn {
    background-color: #007bff;
}
.consult-btn:hover {
    background-color: #0056b3;
}

.actions-buttons button {
    padding: 8px 12px;
    font-size: 0.9rem;
    margin-right: 5px;
    width: auto;
}

.admin-link {
    font-size: 0.9em;
    color: #999;
    text-decoration: none;
}
.admin-link:hover {
    color: #333;
    text-decoration: underline;
}

.back-link {
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-right: 10px;
}
.back-link:hover {
    background-color: #e0e0e0;
}

/* ====================
   Tableaux de données
   ==================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--couleur-bordure);
}

th {
    background-color: var(--couleur-primaire);
    color: white;
}

tr:hover {
    background-color: #f1f1f1;
}

/* ====================
   Défis et classements
   ==================== */
.defi-container {
    border: 1px solid var(--couleur-bordure);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    background-color: #fafafa;
}

.classement-list {
    list-style: none;
    padding: 0;
    font-size: 1.2rem;
}

.classement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--couleur-bordure);
}

.classement-item:last-child {
    border-bottom: none;
}

.classement-item span {
    font-weight: 700;
}

.trophy-icon {
    font-size: 1.4em;
    margin-left: 8px;
    vertical-align: middle;
}

/* ====================
   Graphiques et messages
   ==================== */
.graph-container {
    margin-top: 25px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box; /* Inclusion du padding dans la largeur */
}

.status-message {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Ajout pour la page de gestion des équipes */
.section-separator {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--couleur-bordure);
}

/* Styles pour les jauges de progression */
.gauges-list {
    margin-top: 20px;
}

.gauge-item {
    margin-bottom: 20px;
}

.gauge-name {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gauge-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    height: 20px;
}

.gauge-fill {
    height: 100%;
    background-color: var(--couleur-primaire);
    transition: width 0.5s ease-in-out;
}

.gauge-percentage {
    font-weight: bold;
    margin-top: 5px;
    text-align: right;
    display: block;
    color: var(--couleur-primaire);
}

/* Styles pour les tiroirs de navigation */
.drawer {
    border: 1px solid var(--couleur-bordure);
    border-radius: 10px;
    margin-bottom: 20px;
}
.drawer-header {
    background-color: #f7f7f7;
    padding: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid var(--couleur-bordure);
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header:hover {
    background-color: #eee;
}
.drawer-header-closed {
     border-radius: 10px;
     border-bottom: none;
}
.drawer-header h2 {
    margin: 0;
    color: var(--couleur-texte);
    text-align: left;
}
.drawer-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}
.drawer-content {
    padding: 20px;
    display: none;
}
.drawer-content.active {
    display: block;
}
.rotate-icon {
    transform: rotate(90deg);
}

/* Styles pour la page progression_equipe.php */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Permet aux éléments de passer à la ligne si l'écran est trop petit */
    gap: 10px;
}

/* Assurer la responsivité du graphique */
canvas {
    max-width: 100%;
    height: auto;
}

/* Styles généraux pour le conteneur de graphique */
.chart-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; /* Indispensable pour que le wrapper fonctionne */
    /* Ajustez la hauteur maximale du conteneur parent si besoin */
    max-height: 500px; 
}

/* Règle pour que le canevas remplisse parfaitement son wrapper */
.canvas-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box; /* S'assure que le padding et la bordure sont inclus dans la hauteur */
}


/* Styles pour le trophée */
.trophy-badge {
    color: gold !important; /* Force la couleur dorée */
    font-size: 1.8rem;
    margin-left: 10px;
    vertical-align: middle;
}

/* Styles pour le wrapper du canevas pour contrôler la hauteur */
.canvas-wrapper {
    position: relative;
    width: 100%;
    /* Hauteur fixe pour l'histogramme afin qu'il ne déborde pas */
    height: 350px; 
    overflow: hidden; /* Cache tout ce qui dépasse */
}

