/* Page Résultats des élèves */

.resultats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filtres */
.filters-section {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    min-width: 180px;
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-actions {
    margin-left: auto;
}

.filter-actions .btn {
    white-space: nowrap;
}

/* Statistiques */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Tableau des résultats */
.results-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.results-table th.sortable:hover {
    background: #eee;
}

.results-table th.sortable::after {
    content: ' ↕';
    opacity: 0.3;
}

.results-table th.sortable.asc::after {
    content: ' ↑';
    opacity: 1;
}

.results-table th.sortable.desc::after {
    content: ' ↓';
    opacity: 1;
}

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

.results-table td {
    font-size: 0.95rem;
}

/* Cellules spéciales */
.player-name {
    font-weight: 600;
    color: var(--primary);
}

.game-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-type-icon {
    font-size: 1.2rem;
}

.game-type-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    color: #666;
}

.score-cell {
    font-weight: 600;
}

.score-cell.excellent {
    color: #27ae60;
}

.score-cell.good {
    color: #3498db;
}

.score-cell.medium {
    color: #f39c12;
}

.score-cell.low {
    color: #e74c3c;
}

.score-bar {
    width: 60px;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.score-bar-fill.excellent {
    background: #27ae60;
}

.score-bar-fill.good {
    background: #3498db;
}

.score-bar-fill.medium {
    background: #f39c12;
}

.score-bar-fill.low {
    background: #e74c3c;
}

.errors-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.errors-count.has-errors {
    color: #e74c3c;
}

.errors-count.no-errors {
    color: #27ae60;
}

.duration-cell {
    color: #666;
}

.date-cell {
    font-size: 0.85rem;
    color: #888;
}

/* Actions */
.action-btn {
    padding: 0.4rem 0.6rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #e9ecef;
}

.action-btn.view-errors {
    color: #e74c3c;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Erreurs dans le modal */
.error-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    border-left: 3px solid #e74c3c;
}

.error-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
}

.error-details {
    flex: 1;
}

.error-word {
    font-weight: 600;
    color: #27ae60;
}

.error-answer {
    font-size: 0.85rem;
    color: #666;
}

.error-answer span {
    color: #e74c3c;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.empty-state p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Bouton lien */
.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: inherit;
    text-decoration: underline;
    padding: 0;
}

.link-btn:hover {
    color: var(--primary-dark);
}

/* Modal large */
.modal-large {
    max-width: 700px;
}

/* Badge type */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    background: #e9ecef;
    color: #666;
    margin-left: 0.5rem;
}

.badge-prononciation {
    background: #fce4ec;
    color: #c2185b;
}

.badge-memory {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-qcm {
    background: #fff3e0;
    color: #e65100;
}

.badge-dictee {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-defi {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-complete {
    background: #fffde7;
    color: #f9a825;
}

/* Section pedagogique */
.pedagogie-section {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.pedagogie-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.pedagogie-item {
    background: white;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
}

.pedagogie-label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.pedagogie-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

/* Stats mini dans modal */
.activity-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius);
}

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

.stat-mini .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-mini .stat-label {
    font-size: 0.75rem;
    color: #888;
}

/* Onglets */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content.hidden {
    display: none;
}

/* Tableau mini */
.results-table-mini th,
.results-table-mini td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Liste enregistrements */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recording-player {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 0.75rem;
}

.recording-player h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--primary);
}

.recording-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recording-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.recording-word {
    font-weight: 500;
}

.btn-play-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 4px;
    cursor: pointer;
}

.btn-play-small:hover {
    background: var(--primary);
    color: white;
}

.recording-error {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

.no-data {
    text-align: center;
    color: #888;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .resultats-container {
        padding: 1rem;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group select {
        min-width: 100%;
    }

    .results-table {
        font-size: 0.85rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }

    .score-bar {
        display: none;
    }
}
