.level-page {
    /*padding-top: 70px;*/
    background-color: var(--gray-50);
}

/* ----------------------------------------- */
/* Fil d'Ariane (CORRIGÉ pour mobile)        */
/* ----------------------------------------- */
.breadcrumb-container {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    /* Permet le retour à la ligne si besoin */
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 0.9rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--gray-600);
    font-weight: 500;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: '>';
    display: inline-block;
    padding: 0 10px;
    color: var(--gray-400);
}


/* ----------------------------------------- */
/* Section titre "Waouh" (AMÉLIORÉ)          */
/* ----------------------------------------- */
.page-title-section {
    position: relative;
    padding: 60px 0 80px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
    overflow: hidden;
}

/* Motif subtil en arrière-plan */
.page-title-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle fill="%23FFF" cx="10" cy="10" r="1"/></svg>');
    background-size: 20px 20px;
    opacity: 0.05;
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 400px 400px;
    }
}

/* Forme de vague en bas */
.page-title-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: var(--gray-50);
    clip-path: polygon(0 100%, 100% 100%, 100% 10%, 50% 50%, 0 10%);
}

.page-title-section h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    /* Pour être au-dessus du pseudo-élément */
}

.page-title-section p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Zone de contenu principale */
.content-area {
    display: flex;
    gap: 30px;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* ----------------------------------------- */
/* Filtres "Waouh" (AMÉLIORÉ)                */
/* ----------------------------------------- */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-0);
}

.filters-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark);
}

.close-filters {
    display: none;
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-500);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.filter-select-wrapper {
    position: relative;
}

.filter-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background-color: var(--gray-50);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Cache la flèche par défaut */
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 84, 183, 0.2);
}

.filter-select-wrapper::after {
    content: '\f078';
    /* Icône flèche de FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--gray-500);
    pointer-events: none;
    /* Permet de cliquer à travers l'icône */
}

/* Liste des cours */
.course-list {
    flex-grow: 1;
}

.course-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.course-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.subject-tag {
    background-color: var(--primary-0);
    color: var(--primary-700);
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.difficulty-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 5px;
}

.difficulty-tag.difficulty-facile {
    color: #16a34a;
    background-color: #dcfce7;
}

.difficulty-tag.difficulty-moyen {
    color: #d97706;
    background-color: #fef3c7;
}

.difficulty-tag.difficulty-difficile {
    color: #db2777;
    background-color: #fce7f3;
}

.course-card-body {
    padding: 20px;
    flex-grow: 1;
}

.course-card-body h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.course-card-body p {
    color: var(--gray-600);
    line-height: 1.7;
}

.course-card-footer {
    padding: 0 20px 20px;
    text-align: right;
}

/* ----------------------------------------- */
/* Pagination (CORRIGÉ pour mobile)          */
/* ----------------------------------------- */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    padding-bottom: 20px;
    /* Espace en bas sur mobile */
}

.pagination {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    /* Assure que les éléments passent à la ligne */
    justify-content: center;
    /* Centre les éléments */
    gap: 8px;
}

.page-item .page-link {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s;
}

.page-item.active .page-link,
.page-item .page-link:hover {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-item.disabled .page-link {
    color: var(--gray-400);
    background-color: var(--gray-100);
    pointer-events: none;
}

/* Bouton filtre mobile */
.mobile-filter-trigger {
    display: none;
    /* Caché par défaut, apparaît via media query */
    position: fixed;
    top: 90px;
    /* Positionné sous le header (70px de header + 20px de marge) */
    left: 20px;
    /* Aligné à gauche */
    z-index: 999;
    background: linear-gradient(to right, var(--primary-500), var(--accent-purple));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    /* Légèrement ajusté pour le haut de page */
    font-size: 0.95rem;
    /* Légèrement ajusté */
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s;
}

.mobile-filter-trigger:hover {
    transform: scale(1.05);
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .content-area {
        flex-direction: column;
    }

    .filters-sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1001;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .filters-sidebar.active {
        transform: translateX(0);
    }

    .filters-header {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
        padding: 15px 20px;
    }

    .close-filters {
        display: block;
    }

    .mobile-filter-trigger {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .page-title-section {
        padding: 50px 0 70px;
    }

    .page-title-section h1 {
        font-size: 2.5rem;
    }

    .page-title-section p {
        font-size: 1.1rem;
    }

    .page-title-section::after {
        height: 40px;
    }
}

@media (max-width: 768px) {
    .page-title-section h1 {
        font-size: 2.1rem;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }

    .pagination {
        gap: 5px;
    }

    .page-item .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}