/* --- Styles Généraux --- */

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    background-color: #343a40;
    color: white;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .logo {
    font-size: 1.5em;
    font-weight: bold;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

header nav a:hover:not(.cta-btn) {
    background-color: #495057;
}

.cta-btn {
    background-color: #007bff;
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    padding: 8px 15px;
    transition: background-color 0.2s;
}

.cta-btn:hover {
    background-color: #0056b3;
}

footer {
    text-align: center;
    padding: 20px 5%;
    margin-top: 50px;
    background-color: #343a40;
    color: white;
    font-size: 0.9em;
}


/* --- Styles de la Grille de Cours (index.php) --- */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.course-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    text-align: center;
    
    /* Configuration Flexbox pour le centrage vertical et des boutons */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.course-card h3 {
    color: #343a40;
    margin-top: 15px;
    margin-bottom: 10px;
}

.course-card p {
    color: #6c757d;
    font-size: 0.95em;
    flex-grow: 1; /* Permet au paragraphe de prendre l'espace restant */
}

.icon-card {
    font-size: 3em;
    color: #007bff;
}

/* Conteneur des boutons d'action (Nouveauté pour centrer) */
.card-actions {
    margin-top: auto; /* Pousse le conteneur au bas de la carte */
    padding-top: 15px; 
    text-align: center; /* Centre les éléments inline/inline-block à l'intérieur */
}

.view-course-btn {
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s;
    
    /* Pour que les marges et le centrage du parent fonctionnent */
    display: inline-block; 
    margin: 5px; 
}

.btn-access-principal {
    background-color: #007bff;
    color: white;
}
.btn-access-principal:hover {
    background-color: #0056b3;
}

.btn-edit-course {
    background-color: #ffc107;
    color: #343a40;
}
.btn-edit-course:hover {
    background-color: #e0a800;
}

/* --- Styles de Filtrage (index.php) --- */

.category-range-selector {
    text-align: center;
    margin-bottom: 20px;
}

.btn-range {
    background-color: #e9ecef;
    color: #343a40;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-range:hover {
    background-color: #dee2e6;
}

.btn-range.active-range {
    background-color: #007bff;
    color: white;
}

.category-filter {
    text-align: center;
    padding: 10px 0;
}

.category-tag {
    text-decoration: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    margin: 5px 5px;
    display: inline-block;
    transition: opacity 0.2s;
    white-space: nowrap; /* Empêche les tags de se couper */
}

.category-tag:hover {
    opacity: 0.85;
}

.category-tag.active-filter {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; /* Bordure active */
}

/* Couleurs Cycliques pour les Catégories */
.cat-color-1 { background-color: #dc3545; } /* Rouge */
.cat-color-2 { background-color: #28a745; } /* Vert */
.cat-color-3 { background-color: #007bff; } /* Bleu */
.cat-color-4 { background-color: #ffc107; color: #343a40; } /* Jaune */
.cat-color-5 { background-color: #6c757d; } /* Gris par défaut */