/**
 * mastery-styles.css - Styles pour l'affichage de la maîtrise
 * 
 * Barres de progression colorées + badges de %
 */

/* ========================================
   COULEURS DE MAÎTRISE
   ======================================== */

.mastery-excellent { 
    color: #388e3c; 
    font-weight: 600;
}

.mastery-good { 
    color: #7cb342; 
    font-weight: 600;
}

.mastery-average { 
    color: #fbc02d; 
    font-weight: 600;
}

.mastery-weak { 
    color: #f57c00; 
    font-weight: 600;
}

.mastery-poor { 
    color: #d32f2f; 
    font-weight: 600;
}

/* ========================================
   STRUCTURE CHAPITRES
   ======================================== */

.chapter-block {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.chapter-header {
    padding: 12px 16px;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
}

.chapter-header:hover {
    background: #eeeeee;
}

.chapter-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.chapter-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.chapter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.toggle-icon {
    color: #666;
    font-size: 12px;
    transition: transform 0.2s;
}

.chapter-title {
    flex: 1;
}

.chapter-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    background: #f0f0f0;
}

/* ========================================
   BARRES DE PROGRESSION
   ======================================== */

.mastery-bar-container {
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 8px 0;
    position: relative;
}

.mastery-bar-container.small {
    height: 16px;
    border-radius: 8px;
}

.mastery-bar {
    height: 100%;
    transition: width 0.5s ease, background-color 0.3s;
    border-radius: 12px;
    position: relative;
}

.mastery-bar-container.small .mastery-bar {
    border-radius: 8px;
}

/* Animation au chargement */
@keyframes fillBar {
    from { width: 0; }
}

.mastery-bar {
    animation: fillBar 1s ease-out;
}

/* ========================================
   STATS CHAPITRE
   ======================================== */

.chapter-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 14px;
}

/* ========================================
   ITEMS
   ======================================== */

.items-container {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.items-container.collapsed {
    max-height: 0;
}

.item-block {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: white;
    transition: background 0.2s;
}

.item-block:hover {
    background: #fafafa;
}

.item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.item-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    cursor: pointer;
    font-size: 14px;
}

.item-badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: #f0f0f0;
}

/* ========================================
   STATS ITEMS
   ======================================== */

.item-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    margin-left: 30px;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon-mini {
    font-size: 11px;
}

/* Status colors */
.status-not_started {
    color: #9e9e9e;
}

.status-learning {
    color: #fbc02d;
}

.status-acquired {
    color: #7cb342;
}

.status-mastered {
    color: #388e3c;
    font-weight: 600;
}

/* ========================================
   SECTION HEADER
   ======================================== */

.all-chapters-header {
    padding: 12px 16px;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.chapters-count {
    color: #1976d2;
    margin-left: 8px;
}

/* ========================================
   BOUTONS ACTIONS
   ======================================== */

.selection-actions {
    display: flex;
    gap: 8px;
}

.selection-actions button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.selection-actions button:hover {
    background: #f5f5f5;
    border-color: #1976d2;
}

.select-all-btn {
    color: #388e3c;
}

.unselect-all-btn {
    color: #d32f2f;
}

.expand-all-btn,
.collapse-all-btn {
    color: #666;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .chapter-stats {
        font-size: 12px;
        gap: 12px;
    }
    
    .stat-item {
        flex-basis: calc(50% - 6px);
    }
    
    .selection-actions {
        flex-wrap: wrap;
    }
    
    .selection-actions button {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* ========================================
   ANIMATIONS & TRANSITIONS
   ======================================== */

.chapter-block {
    animation: fadeInUp 0.3s ease;
}

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

/* Hover effects */
.chapter-checkbox:hover,
.item-checkbox:hover {
    transform: scale(1.1);
}

.mastery-bar {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .selection-actions,
    .chapter-checkbox,
    .item-checkbox {
        display: none;
    }
    
    .items-container.collapsed {
        max-height: none !important;
    }
}
