/* Importation de la police depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* Variables de couleur et styles globaux */
:root {
    --primary-color: #005a78; /* Un bleu profond et professionnel */
    --secondary-color: #00a8e8; /* Un bleu plus vif pour les accents */
    --background-color: #f4f7f6;
    --text-color: #333;
    --card-bg-color: #ffffff;
    --footer-bg-color: #2c3e50;
    --success-color: #2ecc71;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Correction Sticky Footer --- */
html {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100%; /* Ajouté */
    display: flex; /* Ajouté */
    flex-direction: column; /* Ajouté */
}

main {
    flex-grow: 1; /* Ajouté pour pousser le footer en bas */
}
/* --- Fin de la correction --- */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: var(--card-bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

header nav a:hover, header nav a.active {
    color: var(--secondary-color);
}

.btn-login {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: var(--secondary-color);
}

/* Boutons */
.btn {
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 6px 12px;
    font-size: 0.9rem;
}
.btn-primary-outline:hover {
    background-color: var(--primary-color);
    color: white;
}


/* Section Hero */
.hero {
    background: linear-gradient(rgba(0, 90, 120, 0.7), rgba(0, 90, 120, 0.7)), url('https://via.placeholder.com/1500x500.png?text=Apprenants+Africains') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 6rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Sections Générales */
main section {
    padding: 4rem 0;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

/* Grille de Cours */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.course-card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.instructor {
    color: #777;
    margin-bottom: 1rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    color: white;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}
.tag-pack { background-color: var(--success-color); }
.tag-course { background-color: var(--secondary-color); }


/* Section How it Works */
.how-it-works {
    background-color: #e8f3f5;
}

.steps {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 2rem;
}

.step .step-number {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Page Catalogue */
.page-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filters input, .filters select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: var(--footer-bg-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer a {
    color: white;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .steps {
        flex-direction: column;
    }
    footer .container {
        flex-direction: column;
        gap: 1rem;
    }
    .filters {
        flex-direction: column;
    }
}
/* Styles pour la page de Connexion/Inscription */
.auth-container {
    max-width: 450px;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.auth-form {
    background: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.auth-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    border: none;
    cursor: pointer;
}

.auth-form p {
    text-align: center;
    margin-top: 1rem;
}

.auth-form a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
}
.auth-form a:hover {
    text-decoration: underline;
}

.auth-message {
    color: red;
    font-size: 0.9rem;
    min-height: 1.2rem;
}
/* Utilitaire pour cacher des éléments avec JS */
.hidden {
    display: none !important;
}

/* Style de la navigation utilisateur dans le header */
#user-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-logout {
    background-color: #c0392b; /* Rouge pour la déconnexion */
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.btn-logout:hover {
    background-color: #e74c3c;
}

.btn-dashboard {
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-color);
}
.btn-dashboard:hover {
    color: var(--secondary-color);
}

/* Styles pour le tableau de bord */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dashboard-card {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.dashboard-card h2 {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
/* Style du bouton Admin */
.btn-admin {
    background-color: var(--success-color);
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.btn-admin:hover {
    opacity: 0.9;
}

/* Styles pour la page Admin */
.admin-container {
    max-width: 800px;
}

.admin-card {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.admin-card h2 {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

#form-message {
    margin-top: 1rem;
    font-weight: 600;
}
/* Styles pour la page d'inscription */
.enrollment-container {
    max-width: 700px;
}

.enrollment-card {
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 2rem;
}

.enrollment-card h2, .enrollment-card h3 {
    text-align: left;
}

.enrollment-card hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #eee;
}

.payment-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin: 1rem 0;
    background-color: #f4f7f6;
    padding: 1rem;
    border-radius: 5px;
}

#enrollment-form {
    margin-top: 2rem;
}

#enrollment-message {
    margin-top: 1rem;
    font-weight: 600;
}
/* Styles pour la liste des demandes en attente */
.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.request-info p {
    margin: 0;
    line-height: 1.4;
}

.request-info strong {
    color: var(--primary-color);
}
/* Style pour les cartes de cours sur le dashboard */
.course-card-small {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    background-color: #f9f9f9;
    padding: 0.75rem;
    border-radius: 5px;
}
.course-card-small img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 3px;
}
.course-card-small-content h4 {
    margin: 0 0 0.5rem 0;
}
/* Styles pour la page d'apprentissage */
.learning-container {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.learning-main {
    flex-grow: 1;
}
.video-player-container {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}
.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.learning-main h1 {
    margin-top: 2rem;
    font-size: 2rem;
}
.learning-sidebar {
    width: 350px;
    flex-shrink: 0;
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}
.learning-sidebar h2 {
    text-align: left;
    font-size: 1.5rem;
    margin-top: 0;
}
#lessons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#lessons-list li {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#lessons-list li:hover {
    background-color: #e9e9e9;
}
#lessons-list li.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}
.btn-google {
    background-color: #4285F4;
    color: white;
    width: 100%;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}
.btn-google:hover {
    background-color: #357ae8;
}
/* --- Correction pour le Footer (Sticky Footer) --- */

html {
    height: 100%;
}

body {
    min-height: 100%; /* Le body prend au minimum toute la hauteur de l'écran */
    display: flex;
    flex-direction: column; /* On aligne les éléments en colonne */
}

main {
    flex-grow: 1; /* Le contenu principal grandit pour occuper l'espace vide */
}
/* Styles pour les pages de contenu statique */
.static-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

.static-content h2 {
    text-align: left;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.static-content p {
    margin-bottom: 1rem;
}

#contact-form {
    margin-top: 2rem;
}
/* --- Styles pour la page de profil --- */

.profile-container {
    max-width: 600px;
    margin: 0 auto;
}

.profile-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.profile-card h2 {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

#profile-email[disabled] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.info-text {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.form-message {
    margin-top: 1rem;
    font-weight: 600;
}
/* Style pour la barre de progression */
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}
.progress-bar {
    height: 10px;
    background-color: var(--success-color);
    border-radius: 0.25rem;
    width: 0%; /* La largeur sera définie par JavaScript */
    transition: width 0.5s ease-in-out;
}
.course-card-small p {
    font-size: 0.8rem;
    color: #6c757d;
}
#lessons-list li.completed {
    background-color: #e2fbe2;
    color: #155724;
    text-decoration: line-through;
}
/* Styles pour la nouvelle page d'apprentissage */
.learning-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.back-to-dashboard-btn {
    display: block;
    margin-bottom: 1rem;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    color: var(--secondary-color);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.lesson-header h1 {
    margin: 0;
}

.lesson-content-box {
    background: white;
    padding: 2rem;
    margin-top: 1.5rem;
    border-radius: 8px;
}

.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}
.btn-danger {
    background-color: #dc3545; /* Rouge */
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}