/* =====================================================
   STYLES POUR LA SECTION FORMATION BIBLIQUE (LEÇONS)
   Inspiré du design CMCI Obili
   ===================================================== */

/* ===== WRAPPER GÉNÉRAL ===== */
.lecons-wrapper,
.stats-wrapper,
.badges-wrapper,
.exercices-wrapper,
.lecon-content-wrapper,
.lecon-detail-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== HEADER DE SECTION ===== */
.lecons-header,
.stats-header,
.badges-header,
.exercices-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    position: relative;
    overflow: hidden;
    color: white;
}

.lecons-header-content,
.stats-header-content,
.badges-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.lecons-header h1,
.stats-header h1,
.badges-header h1 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.lecons-header p,
.stats-header p,
.badges-header p {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.95;
}

/* ===== FILTRES & CATÉGORIES ===== */
.filters-section,
.badges-categories {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.filters-container,
.badges-categories {
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 50px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    box-shadow: 0 5px 15px var(--shadow-light);
}

[data-theme="black"] .filters-container,
[data-theme="black"] .badges-categories {
    background: rgba(66, 66, 66, 0.8);
}

.filter-btn,
.category-btn {
    padding: 10px 25px;
    border-radius: 30px;
    border: none;
    background: transparent;
    color: var(--primary-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover,
.category-btn:hover {
    background: var(--hover-bg);
}

.filter-btn.active,
.category-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px var(--shadow-color);
}

/* ===== CARTE DE PROGRESSION (PAGE MODULES) ===== */
.progression-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px var(--shadow-light);
    border-left: 4px solid var(--primary-color);
}

.progression-card h3 {
    font-size: 1.3em;
    color: var(--primary-color);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progression-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 0.9em;
    color: #777;
}

/* ===== GRILLE DES MODULES ===== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.module-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.module-card.completed {
    border: 2px solid var(--accent-color);
}

.module-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.module-icon {
    font-size: 2.5em;
    color: var(--primary-color);
}

.module-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    color: white;
}

.badge-debutant { background: #4caf50; }
.badge-intermediaire { background: #ff9800; }
.badge-avance { background: #f44336; }

.module-body {
    padding: 0 20px 20px;
    flex: 1;
}

.module-title {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.module-description {
    font-size: 0.95em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    min-height: 50px;
}

.module-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #777;
    margin-bottom: 15px;
}

.module-stats .stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.module-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: var(--light-bg);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary-dark);
}

.module-footer {
    padding: 20px;
    background: var(--hover-bg);
    text-align: center;
}

.complete-badge {
    color: var(--accent-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== PAGE DÉTAIL DE LEÇON (lecon.html) ===== */
.lecon-content-wrapper .lecon-body {
    display: flex;
    gap: 30px;
}

.lecon-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.lecon-sidebar .sidebar-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    position: sticky;
    top: 120px;
}

.lecon-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lecon-nav .nav-item {
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.lecon-nav .nav-item:hover {
    background: var(--hover-bg);
    border-left-color: var(--primary-color);
}

.lecon-nav .nav-item.active {
    background: var(--light-bg);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.lecon-main-content {
    flex: 1;
}

.content-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    scroll-margin-top: 120px;
}

.content-section h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.versets-container .verset-card {
    background: var(--hover-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-color);
}

.verset-reference {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.verset-texte {
    font-style: italic;
    color: #555;
    line-height: 1.7;
}

.enseignement-content {
    line-height: 1.8;
    color: #333;
}

.medias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.media-card video,
.media-card img,
.media-card audio {
    width: 100%;
    border-radius: 10px;
}

.exercices-info {
    text-align: center;
    padding: 20px;
}

/* ===== PAGE EXERCICES ===== */
.exercices-header {
    padding: 25px 40px;
}

.exercices-progress-bar {
    margin-top: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.exercices-container {
    min-height: 300px;
}

.exercice-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.exercice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.exercice-type {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.exercice-points {
    font-weight: 600;
    color: var(--accent-color);
}

.exercice-question h3 {
    font-size: 1.4em;
    margin-bottom: 25px;
}

.exercice-reponses {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reponse-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--hover-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.reponse-option:hover {
    border-color: var(--primary-color);
}

.reponse-option input[type="radio"] {
    width: 20px;
    height: 20px;
}

.reponse-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    resize: vertical;
}

.exercices-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Modal Résultats */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.results-summary.success .results-icon { color: #4caf50; }
.results-summary.warning .results-icon { color: #ff9800; }

.results-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.results-score {
    font-size: 3em;
    font-weight: bold;
    margin: 10px 0;
}

.results-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}

.modal-footer {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== PAGE MES LEÇONS ===== */
.stats-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-cards-grid .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
}

.mes-lecons-list .ma-lecon-card {
    background: white;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.ma-lecon-card .lecon-card-header {
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.ma-lecon-card .lecon-icon {
    font-size: 2em;
}

.ma-lecon-card .lecon-info {
    flex: 1;
}

.ma-lecon-card .lecon-card-body {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.ma-lecon-card .lecon-card-footer {
    padding: 20px;
    background: var(--hover-bg);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== PAGE STATS ===== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
}

.leaderboard-list .leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* ===== PAGE BADGES ===== */
.badges-grid .badge-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow-light);
}

.badge-card.locked {
    opacity: 0.6;
}

.badge-card .badge-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .lecon-content-wrapper .lecon-body {
        flex-direction: column;
    }
    .lecon-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 768px) {
    .lecons-header h1, .stats-header h1, .badges-header h1 {
        font-size: 1.8em;
    }
    .modules-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}