/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    text-align: left;
}

.header-content h1 {
    font-size: 1.8rem;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
}

.header-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
    font-size: 14px;
    color: #4a5568;
}

.user-info .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.header h1 i {
    color: #667eea;
    margin-right: 15px;
}

.header p {
    color: #718096;
    font-size: 1.1rem;
}

/* Navigation */
.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Zone de message admin */
.admin-message-zone {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    margin: 0 20px 25px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.admin-message-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.admin-message-zone:empty {
    display: none;
}

.admin-message-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 25px;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.admin-message-text {
    flex: 1;
    line-height: 1.6;
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 400;
}

.admin-message-text:empty::before {
    content: "💬 Aucun message configuré";
    color: #718096;
    font-style: italic;
    font-size: 0.9em;
    opacity: 0.8;
}

.admin-message-text h1, 
.admin-message-text h2, 
.admin-message-text h3 {
    margin: 0 0 12px 0;
    color: #1a202c;
    font-weight: 600;
}

.admin-message-text h1 { font-size: 1.4em; }
.admin-message-text h2 { font-size: 1.25em; }
.admin-message-text h3 { font-size: 1.1em; }

.admin-message-text p {
    margin: 0 0 10px 0;
    color: #2d3748;
}

.admin-message-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.admin-message-text a:hover {
    background: rgba(102, 126, 234, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

.admin-message-text ul, 
.admin-message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.admin-message-text li {
    margin-bottom: 4px;
}

.admin-message-actions {
    flex-shrink: 0;
}

.admin-message-actions button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.admin-message-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 120px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

.nav-btn i {
    margin-right: 8px;
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: calc(100vh - 100px);
    max-height: none;
    overflow-y: visible;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

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

.header-actions {
    display: flex;
    gap: 10px;
}

.view-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
}

.view-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Filtres */
.filters-section {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.filter-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #4a5568;
    transition: all 0.3s ease;
    min-width: 120px;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-filters-btn {
    padding: 8px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.clear-filters-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Styles pour la validation par groupe */
.group-student-list {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.group-student-list h5 {
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 16px;
}

.student-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
}

.student-checkbox-item {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.student-checkbox-item:hover {
    background-color: #f7fafc;
}

.student-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.student-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.student-checkbox-item .student-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.student-checkbox-item .student-info strong {
    color: #2d3748;
    font-size: 14px;
}

.student-checkbox-item .student-info small {
    color: #718096;
    font-size: 12px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #718096;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Élèves Grid */
.eleves-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
    max-height: none !important;
    overflow-y: visible !important;
}

.eleve-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.eleve-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.eleve-card h3 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.eleve-card p {
    color: #718096;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.eleve-card .eleve-stats {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

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

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Styles pour les images des élèves en rond */
.eleve-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.eleve-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Styles pour les tests */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
    max-width: 100%;
}

/* Styles pour la vue détaillée d'un élève */
.eleve-detail-container {
    padding: 20px;
}

.eleve-detail-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.eleve-detail-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eleve-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.eleve-detail-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.eleve-detail-card .eleve-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.eleve-detail-card .eleve-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eleve-detail-card .eleve-photo i {
    font-size: 3rem;
    color: #a0aec0;
}

.eleve-info h4 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.eleve-info p {
    margin-bottom: 8px;
    color: #4a5568;
}

.eleve-stats-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
}

.eleve-stats-card h4 {
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
}

.resultats-table-container {
    overflow-x: auto;
}

.resultats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.resultats-table th,
.resultats-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.resultats-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.resultats-table tr:hover {
    background: #f8f9fa;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Styles pour les images de tests */
.test-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.test-image-container {
    flex-shrink: 0;
    width: 200px;
    height: 112px; /* 16:9 ratio (200/16*9 = 112.5) */
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.test-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-align: center;
    padding: 20px;
}

.test-image-placeholder .icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.test-image-placeholder span {
    font-size: 0.9rem;
    font-weight: 500;
}

.test-details {
    flex: 1;
}

/* Responsive pour les images de tests */
@media (max-width: 768px) {
    .test-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .test-image-container {
        width: 100%;
        height: 180px; /* 16:9 ratio pour mobile */
    }
}

/* Styles pour la hiérarchie des tests */
.hierarchy-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hierarchy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.hierarchy-header h3 {
    color: #2d3748;
    margin: 0;
    font-size: 1.3rem;
}

.hierarchy-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Styles pour les onglets de catégories */
.category-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    padding: 0 5px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.tab-button:hover {
    background: #e2e8f0;
    color: #2d3748;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.tab-button i {
    font-size: 1rem;
}

/* Styles pour les statistiques de catégorie */
.category-info {
    flex: 1;
    margin-right: 15px;
}

.category-stats {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.stat-item i {
    font-size: 0.8rem;
    color: #4b5563;
}

.hierarchy-category-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #667eea;
    margin-bottom: 10px;
}

.hierarchy-test-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.category-icon {
    font-size: 1.5rem;
}

.category-title {
    color: #2d3748;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.category-children {
    margin-left: 20px;
    border-left: 2px solid #e9ecef;
    padding-left: 15px;
}

.hierarchy-level-1 {
    border-left-color: #667eea;
}

.hierarchy-level-2 {
    border-left-color: #48bb78;
}

.hierarchy-level-3 {
    border-left-color: #ed8936;
}

.test-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.test-info-compact {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
}

.test-info-compact p {
    margin: 5px 0;
    color: #6b7280;
}

/* Responsive pour la hiérarchie */
@media (max-width: 768px) {
    .hierarchy-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    
    .category-children {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* Styles pour les tests par catégorie */
.tests-by-category {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.test-category-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.test-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.test-category-header h4 {
    color: #2d3748;
    font-size: 1.2rem;
    margin: 0;
}

.test-unit {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.test-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-result-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 15px;
    align-items: center;
}

.test-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.test-result-item.record {
    border: 2px solid #fbbf24;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    position: relative;
}

.test-result-item.record::before {
    content: "🏆";
    position: absolute;
    top: -8px;
    left: -8px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.test-result-item.latest {
    border-left: 4px solid #10b981;
}

.result-date {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

.result-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-value strong {
    color: #2d3748;
    font-size: 1.1rem;
}

.record-badge {
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.latest-badge {
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.result-comment {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive pour la vue détaillée */
@media (max-width: 768px) {
    .eleve-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .eleve-detail-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .test-result-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .result-value {
        justify-content: center;
    }
}

.test-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    max-width: 100%;
    overflow: hidden;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.test-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.test-status {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.test-status.active {
    background: #c6f6d5;
    color: #2f855a;
}

.test-status.inactive {
    background: #fed7d7;
    color: #c53030;
}

.test-info {
    margin-bottom: 15px;
}

.test-info p {
    margin: 5px 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.test-info strong {
    color: #2d3748;
}

.test-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.test-stats {
    background: #f7fafc;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.test-stats h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1rem;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stats-label {
    color: #718096;
}

.stats-value {
    color: #2d3748;
    font-weight: 500;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    color: #2d3748;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 30px;
}

/* Status Badge */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.success {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.error {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.warning {
    background: #fef5e7;
    color: #744210;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .view-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-actions {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .filter-select {
        min-width: auto;
        flex: 1;
    }
    
    .clear-filters-btn {
        width: 100%;
        justify-content: center;
    }
    
    .eleves-grid {
        grid-template-columns: 1fr;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .test-card {
        padding: 15px;
    }
    
    .nav {
        flex-direction: column;
    }
    
    .nav-btn {
        flex: none;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
}

/* Animations pour les notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Styles pour les formulaires */
form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2d3748;
}

form input, form select {
    transition: all 0.3s ease;
}

form input:focus, form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

form input:invalid, form select:invalid {
    border-color: #e53e3e;
}

/* Responsive pour les formulaires */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    form .grid {
        grid-template-columns: 1fr;
    }
}

/* Styles pour les tests détaillés */
.test-info-detailed {
    margin: 10px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #4299e1;
}

.test-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.test-text-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-details-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.test-unite, .test-results {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #4a5568;
    font-size: 0.9rem;
}

.test-description, .test-modalites, .test-objectifs {
    margin: 8px 0;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.test-description strong, .test-modalites strong, .test-objectifs strong {
    color: #2d3748;
    display: block;
    margin-bottom: 4px;
}

.test-image-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.test-image-preview {
    width: 100%;
    max-width: 100%;
    text-align: center;
}

.test-image-16-9 {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.test-image-16-9:hover {
    transform: scale(1.02);
}

/* Responsive pour les détails de test */
@media (max-width: 768px) {
    .test-content-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .test-details-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .test-info-detailed {
        padding: 10px;
    }
    
    .test-image-content {
        min-height: 150px;
    }
    
    .test-image-16-9 {
        max-width: 100%;
    }
    
    .category-tabs {
        gap: 3px;
        padding: 0 2px;
    }
    
    .tab-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .category-stats {
        gap: 8px;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
}

/* Styles pour les barres de progression des compétences */
.competence-progress {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill[style*="100%"] {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.progress-fill[style*="0%"] {
    background: #6c757d;
}

.progress-text {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    min-width: 80px;
}

/* Styles pour le modal de validation des compétences */
.validation-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-summary {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.filter-summary h5 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 0.9rem;
}

#filter-summary-text {
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

#filtered-students-count {
    font-size: 0.85rem;
    color: #6c757d;
}

.competence-selection {
    margin-top: 20px;
}

.competence-tree {
    max-height: none !important;
    overflow-y: visible !important;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

.competence-tree-item {
    margin-bottom: 8px;
}

.tree-item-header {
    display: flex;
    align-items: center;
}

.tree-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tree-checkbox:hover {
    background: #f8f9fa;
}

.tree-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.tree-icon {
    font-size: 1.1rem;
}

.tree-title {
    font-weight: 500;
    color: #212529;
}

.tree-children {
    margin-left: 20px;
    margin-top: 4px;
}

/* Styles pour les modes de validation */
.validation-mode-selector {
    margin-bottom: 20px;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.mode-btn:hover:not(.active) {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* Styles pour les modes de résultats */
.resultat-mode-content {
    margin-bottom: 20px;
}

.eleve-selection, .group-selection, .test-selection {
    margin-bottom: 20px;
}

.eleve-selection h4, .group-selection h4, .test-selection h4 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1rem;
}

.resultat-input {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.resultat-input h4 {
    margin-bottom: 15px;
    color: #495057;
}

.selected-eleves {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-height: 300px;
    overflow-y: auto;
}

.selected-eleves h4 {
    margin-bottom: 15px;
    color: #495057;
}

.eleve-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.eleve-name {
    font-weight: 500;
    color: #2d3748;
    flex: 1;
}

.resultat-input-eleve {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: right;
}

.resultat-input-eleve:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Styles pour les filtres de sélection */
.selection-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* Styles pour la liste des élèves */
.eleves-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

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

.eleves-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 15px !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 10px !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
}

/* Responsive pour mobile - 1 carte par ligne */
@media (max-width: 768px) {
    .eleves-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 8px !important;
        min-height: calc(100vh - 250px) !important;
    }
    
    .eleve-card {
        padding: 12px !important;
    }
    
    .eleve-avatar {
        width: 35px !important;
        height: 35px !important;
    }
}

.eleve-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.eleve-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.eleve-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.eleve-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.eleve-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eleve-details h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.eleve-details p {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    color: #718096;
}

.eleve-resultat {
    margin-left: 15px;
}

.eleve-resultat .resultat-input-eleve {
    width: 100px;
    text-align: center;
    font-weight: 500;
}

.no-eleves {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
    grid-column: 1 / -1;
}

.competence-selection {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.competence-selection h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.competence-selection .form-group {
    margin-bottom: 0;
}

.competence-selection select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.competence-selection select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Styles pour les compétences validées dans la fiche élève */
.competences-validated {
    margin-top: 15px;
}

.validated-competence {
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.competence-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.competence-icon {
    font-size: 1.2em;
}

.competence-name {
    font-weight: 500;
    color: #2d3748;
    flex: 1;
}

.competence-level {
    font-size: 0.8em;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 12px;
    margin-right: 10px;
}

.validation-date {
    font-size: 0.9em;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 5px;
}

.validation-date i {
    color: #28a745;
}

/* Styles pour les statistiques des compétences */
.competence-stats-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.competence-stats-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2em;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #2d3748;
    line-height: 1;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 2px;
}

.category-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.category-stats h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.1rem;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.875em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.btn-outline-success {
    background: transparent;
    border: 1px solid #28a745;
    color: #28a745;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.875em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-success:hover {
    background: #28a745;
    color: white;
}

.category-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Styles pour le Top 3 des élèves */
.top3-students-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.top3-students-container h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.top3-students-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.top3-student-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 200px;
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;
}

.top3-student-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.top3-student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
}

.student-rank {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.student-photo {
    margin-bottom: 15px;
    position: relative;
}

.student-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f8f9fa;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.student-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.student-info {
    flex: 1;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    line-height: 1.2;
}

.student-validations {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.validations-count {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.validations-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

/* Responsive design pour le Top 3 */
@media (max-width: 768px) {
    .top3-students-grid {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .top3-student-card {
        width: 100%;
        max-width: 300px;
    }
    
    .student-avatar {
        width: 60px;
        height: 60px;
    }
    
    .student-avatar-fallback {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.2em !important;
    }
    
    .validations-count {
        font-size: 1.5rem;
    }
}

.category-stat-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.category-icon {
    font-size: 1.2em;
}

.category-name {
    font-weight: 500;
    color: #2d3748;
}

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

.validation-count {
    color: #28a745;
    font-weight: 500;
}

.student-count {
    color: #6c757d;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

/* Responsive pour les statistiques */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .category-numbers {
        flex-direction: column;
        gap: 5px;
    }
}

.mode-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn.active {
    background: #1976d2 !important;
    color: white !important;
    border-color: #1976d2 !important;
}

/* Styles pour la grille d'élèves */
.student-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Colonnes encore plus petites */
    grid-auto-rows: 1fr; /* Force les lignes à s'étendre pour remplir l'espace */
    gap: 10px; /* Espacement réduit */
    max-height: none;
    overflow-y: visible;
    padding: 15px; /* Padding réduit */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    height: 100% !important; /* Force l'utilisation de toute la hauteur */
    min-height: 100% !important; /* Force la hauteur minimale */
    flex: 1 !important; /* Prend tout l'espace disponible dans le conteneur flex */
    align-content: stretch !important; /* Étire le contenu pour remplir l'espace */
}

/* Styles pour la grille de sélection d'élèves dans la modal */
.student-grid {
    height: 100% !important; /* Utilise toute la hauteur disponible */
    max-height: none !important;
    overflow-y: visible !important;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important; /* Force l'expansion pour prendre tout l'espace */
}

/* Styles pour la section de sélection d'élèves */
.student-selection {
    margin-bottom: 20px;
    flex: 1; /* Prend tout l'espace disponible */
    display: flex;
    flex-direction: column;
}

.student-selection h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.student-card {
    display: flex;
    align-items: center;
    gap: 12px; /* Espacement réduit */
    padding: 16px; /* Padding réduit */
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    height: 100% !important; /* Force la carte à utiliser toute la hauteur disponible */
    min-height: 100% !important; /* Force la hauteur minimale */
    align-self: stretch !important; /* Étire la carte pour remplir la grille */
    box-sizing: border-box; /* Inclut le padding dans la hauteur */
}

.student-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.student-card.selected {
    border-color: #28a745;
    background: #f8fff9;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.student-avatar {
    width: 60px; /* Taille optimisée pour plus de compacité */
    height: 60px; /* Taille optimisée pour plus de compacité */
    border-radius: 50%;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-avatar i {
    font-size: 2rem; /* Augmentation de 50% supplémentaires (1.5rem + 50% = 2rem) */
    color: #6c757d;
}

.student-info h5 {
    margin: 0 0 8px 0; /* Augmentation supplémentaire de l'espacement */
    font-size: 1.2rem; /* Augmentation de 50% supplémentaires (1rem + 20% = 1.2rem) */
    font-weight: 600;
    color: #212529;
}

.student-info p {
    margin: 0;
    font-size: 1rem; /* Augmentation de 50% supplémentaires (0.9rem + 11% = 1rem) */
    color: #6c757d;
    line-height: 1.4; /* Amélioration supplémentaire de la lisibilité */
}

/* Styles pour les compétences déjà validées */
.tree-checkbox input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.tree-title {
    position: relative;
}

.tree-title::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #28a745;
    border-radius: 50%;
    display: none;
}

.tree-checkbox input[disabled] + .tree-icon + .tree-title::after {
    display: block;
}

/* Styles pour le modal plein écran */
.modal-content[style*="98vw"] {
    margin: 1vh auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-content[style*="98vw"] .modal-body {
    padding: 20px;
    max-height: calc(98vh - 120px);
    overflow-y: auto;
}

/* Styles pour le modal-body dans la validation */
.modal-body {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: calc(95vh - 120px) !important; /* Assure une hauteur minimale */
    flex: 1 !important; /* Force l'expansion pour prendre tout l'espace */
    overflow: hidden; /* Empêche le débordement */
}

/* Styles spécifiques pour forcer l'expansion de la grille dans la modal de validation */
.validation-mode {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    flex: 1 !important;
}

.validation-mode .student-selection {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.validation-mode .student-grid {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* Responsive pour le modal de validation */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .competence-tree {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .student-cards {
        grid-template-columns: 1fr;
        min-height: 400px; /* Ajustement pour mobile */
    }
    
    .student-card {
        padding: 8px;
        min-height: 80px; /* Ajustement pour mobile */
    }
    
    .student-avatar {
        width: 40px; /* Ajustement pour mobile */
        height: 40px;
    }
    
    .modal-content[style*="98vw"] {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
}

/* Styles spécifiques pour le mode individuel */
#individual-validation-mode .student-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
}

#individual-validation-mode .student-card {
    padding: 10px !important;
    min-height: 70px !important;
    gap: 8px !important;
}

#individual-validation-mode .student-avatar {
    width: 45px !important;
    height: 45px !important;
    font-size: 1rem !important;
}

#individual-validation-mode .student-info h5 {
    font-size: 0.9rem !important;
    margin-bottom: 2px !important;
}

#individual-validation-mode .student-info p {
    font-size: 0.75rem !important;
    margin: 0 !important;
}

/* Styles pour les boutons de déploiement/réduction */
.expand-collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.3s ease;
    color: #667eea;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.expand-collapse-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

.expand-collapse-btn.collapsed {
    transform: rotate(-90deg);
}

.expand-collapse-btn.expanded {
    transform: rotate(0deg);
}

.category-children {
    transition: all 0.3s ease;
    overflow: hidden;
}

.category-children.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.category-children.expanded {
    max-height: 2000px;
    opacity: 1;
}

/* Styles pour les modals de médias */
.media-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.media-container {
    text-align: center;
    padding: 20px;
}

.media-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.video-fallback {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
}

.video-fallback .btn {
    margin-top: 15px;
}

/* Styles pour le test de motivation */
.question-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.question-group h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

.question-group p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.reponse-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reponse-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reponse-option:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.reponse-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.1);
}

.reponse-option input[type="radio"]:checked + .option-text {
    color: #667eea;
    font-weight: 600;
}

.option-text {
    flex: 1;
    font-size: 0.9em;
    color: #495057;
}

/* Styles pour l'affichage des tests de motivation */
.tests-motivation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.test-motivation-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s ease;
}

.test-motivation-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.badge-success {
    background: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
}

.badge-danger {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
}
