/**
 * Caly-Quiz IRVE - Interface LMS Parcours
 * Design inspiré Habilec 7
 * Cartes de chapitres avec progression
 */

/* ============================================
   VARIABLES & COULEURS IRVE
   ============================================ */
:root {
    --lms-primary: #f59e0b;        /* Orange/Jaune Habilec */
    --lms-primary-dark: #d97706;
    --lms-primary-light: #fbbf24;
    --lms-bg-dark: #1e3a5f;
    --lms-bg-card: #fffbeb;        /* Fond crème des cartes */
    --lms-bg-header: #f59e0b;      /* Header orange */
    --lms-text-dark: #1f2937;
    --lms-text-light: #6b7280;
    --lms-success: #22c55e;
    --lms-border: #e5e7eb;
    --lms-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CONTAINER PARCOURS
   ============================================ */
#lms-parcours-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
}

#lms-parcours-container.hidden {
    display: none !important;
}

.parcours-container {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    padding-bottom: 100px;
}

/* ============================================
   HEADER PARCOURS
   ============================================ */
.parcours-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--lms-primary);
}

.parcours-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.parcours-logo img {
    height: 50px;
}

.parcours-logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.parcours-logo-text span {
    color: var(--lms-primary);
}

.parcours-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.parcours-nav-item {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.parcours-nav-item:hover,
.parcours-nav-item.active {
    color: white;
    background: rgba(245, 158, 11, 0.2);
}

.parcours-nav-icons {
    display: flex;
    gap: 1rem;
}

.parcours-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.2s ease;
}

.parcours-nav-icon:hover {
    background: var(--lms-primary);
    color: white;
}

/* ============================================
   GRILLE DES CHAPITRES
   ============================================ */
.chapitres-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 2rem;
}

.chapitres-grid::-webkit-scrollbar-thumb {
    background: var(--lms-primary);
    border-radius: 4px;
}

/* ============================================
   CARTE CHAPITRE
   ============================================ */
.chapitre-card {
    flex: 0 0 380px;
    max-width: 420px;
    background: var(--lms-bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--lms-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chapitre-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Header de la carte */
.chapitre-header {
    background: var(--lms-primary);
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.chapitre-title {
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

/* Contenu de la carte */
.chapitre-content {
    padding: 1.25rem 1.5rem;
    max-height: 320px;
    overflow-y: auto;
}

.chapitre-content::-webkit-scrollbar {
    width: 4px;
}

.chapitre-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* Liste des leçons */
.lecons-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lecon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lecon-item:last-child {
    border-bottom: none;
}

.lecon-item:hover {
    background: rgba(245, 158, 11, 0.05);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.lecon-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lecon-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--lms-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.lecon-title {
    font-size: 0.9rem;
    color: var(--lms-text-dark);
    font-weight: 500;
}

.lecon-check {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--lms-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.lecon-check.pending {
    background: #e5e7eb;
    color: #9ca3af;
}

/* Footer de la carte */
.chapitre-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: center;
}

.btn-lire-chapitre {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--lms-primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-lire-chapitre:hover {
    background: var(--lms-primary-dark);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-lire-chapitre svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   BARRE DE NAVIGATION INFÉRIEURE
   ============================================ */
.parcours-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.btn-retour {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
    background: white;
    border: 2px solid var(--lms-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retour:hover {
    background: var(--lms-primary);
    color: white;
}

.parcours-title-bar {
    text-align: center;
}

.parcours-title-label {
    font-size: 0.85rem;
    color: var(--lms-text-light);
    margin-bottom: 0.25rem;
}

.parcours-title-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #92400e;
}

.btn-lire-parcours {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
    background: white;
    border: 2px solid var(--lms-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lire-parcours:hover {
    background: var(--lms-primary);
    color: white;
}

/* ============================================
   BARRE DE PROGRESSION
   ============================================ */
.progress-bar-container {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 8px;
    background: #e5e7eb;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lms-primary) 0%, var(--lms-primary-light) 100%);
    border-radius: 0 4px 4px 0;
    transition: width 0.5s ease;
}

/* ============================================
   PAGE SÉLECTION PARCOURS
   ============================================ */
.parcours-selection {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.parcours-selection-title {
    text-align: center;
    margin-bottom: 3rem;
}

.parcours-selection-title h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    color: var(--lms-text-dark);
    margin-bottom: 0.5rem;
}

.parcours-selection-title p {
    color: var(--lms-text-light);
    font-size: 1.1rem;
}

.parcours-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.parcours-category-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--lms-shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.parcours-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.parcours-category-header {
    background: var(--lms-primary);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.parcours-category-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.parcours-category-info h3 {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.parcours-category-info span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.parcours-category-content {
    padding: 1.25rem;
}

.parcours-category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

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

.parcours-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e;
}

.parcours-stat-label {
    font-size: 0.75rem;
    color: var(--lms-text-light);
    text-transform: uppercase;
}

.parcours-category-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.parcours-category-progress-fill {
    height: 100%;
    background: var(--lms-success);
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .chapitres-grid {
        padding: 1.5rem 1rem;
    }

    .chapitre-card {
        flex: 0 0 320px;
    }
}

@media (max-width: 768px) {
    .parcours-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .parcours-nav {
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .chapitre-card {
        flex: 0 0 calc(100vw - 2rem);
    }

    .parcours-bottom-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .btn-retour,
    .btn-lire-parcours {
        width: 100%;
        justify-content: center;
    }

    .parcours-selection {
        padding: 1.5rem 1rem;
    }

    .parcours-selection-title h1 {
        font-size: 1.75rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chapitre-card {
    animation: slideInFromRight 0.4s ease forwards;
}

.chapitre-card:nth-child(1) { animation-delay: 0.1s; }
.chapitre-card:nth-child(2) { animation-delay: 0.2s; }
.chapitre-card:nth-child(3) { animation-delay: 0.3s; }
.chapitre-card:nth-child(4) { animation-delay: 0.4s; }
.chapitre-card:nth-child(5) { animation-delay: 0.5s; }

/* ============================================
   BOUTONS ÉDITION
   ============================================ */
.btn-create-course {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--lms-primary);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-create-course:hover {
    background: var(--lms-primary-dark);
    transform: scale(1.02);
}

.btn-create-course svg {
    width: 20px;
    height: 20px;
}

.btn-edit-chapitre {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--lms-border);
    color: var(--lms-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.btn-edit-chapitre:hover {
    background: var(--lms-primary);
    border-color: var(--lms-primary);
    color: white;
}

.btn-edit-chapitre svg {
    width: 18px;
    height: 18px;
}

.chapitre-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
