/*
 * Feuille de style pour l'application de gestion des cours.
 *
 * Thème moderne et coloré : rouge, blanc et doré.
 */

/* Variables de couleur */
:root {
    --primary: #D32F2F; /* rouge profond */
    --secondary: #FBC02D; /* doré */
    --background: #ffffff; /* blanc */
    --text: #333333; /* gris foncé pour un meilleur contraste */
    --border: #e0e0e0; /* gris clair pour les lignes */
}

/* Style global */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

header {
    background-color: var(--primary);
    color: var(--background);
    padding: 1rem 2rem;
    margin-bottom: 1rem;
}

/* Disposition de l'en-tête pour inclure les liens de connexion/inscription */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.auth-links a {
    color: var(--background);
    margin-left: 0.5rem;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

main {
    width: 90%;
    max-width: 960px;
    margin: 0 auto;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    background-color: var(--secondary);
    color: var(--background);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn.primary {
    background-color: var(--primary);
    color: var(--background);
}

.btn:hover {
    opacity: 0.9;
}

/* Table de cours */
.course-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.course-table th, .course-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    text-align: left;
}

.course-table thead {
    background-color: var(--primary);
    color: var(--background);
}

.course-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Formulaire de création */
.course-form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

.course-form input[type="text"],
.course-form select,
.course-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 1rem;
}

/* Alertes */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert.error {
    background-color: #ffebee;
    color: #c62828;
}

.alert.success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--secondary);
    color: var(--background);
    border-radius: 20px;
    font-weight: bold;
}

/* Champs du quiz */
.quiz-form .field {
    margin-bottom: 0.5rem;
}

/* Petites cartes de description et de contenu */
.course-description, .course-content {
    margin-bottom: 1rem;
}

.course-description h2, .course-content h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 0.25rem;
}

.course-level {
    font-style: italic;
    margin-top: 0.25rem;
    color: var(--secondary);
}

/* Styles pour les catégories et les listes de cours */
.category-block {
    margin-bottom: 2rem;
}

.category-block h2 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.course-list {
    list-style: none;
    padding-left: 1rem;
}

.course-list li {
    margin: 0.25rem 0;
}

/* Formulaires d'authentification */
.auth-form label {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 0.25rem;
}

/* Note explicative */
.note {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 0.5rem;
}

/* Groupes de questions pour la création de test */
.question-group {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.question-group legend {
    font-weight: bold;
    color: var(--primary);
}

/* Liste des questions existantes */
.existing-questions {
    padding-left: 1.5rem;
}

.existing-questions li {
    margin-bottom: 0.75rem;
}

/* Fieldset d'évaluation */
.evaluation-form fieldset {
    border: none;
    margin-bottom: 1rem;
    padding: 0;
}

.evaluation-form legend {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.25rem;
}