* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container h1 {
    color: #1a73e8;
    margin-bottom: 30px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #1a73e8;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

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

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Messages */
.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Header */
.header {
    background-color: #1a73e8;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.header nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

.header nav a.active {
    background-color: rgba(255,255,255,0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #1a73e8;
    padding-bottom: 10px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
}

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

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

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

table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* QCM Interface */
.qcm-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
}

.question-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.question-number {
    color: #1a73e8;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.question-text-en {
    color: #666;
    font-style: italic;
    font-size: 1rem;
    margin-top: 10px;
}

.answers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.answer-item {
    margin-bottom: 12px;
}

.answer-label {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-label:hover {
    border-color: #1a73e8;
    background-color: #e8f0fe;
}

.answer-label input {
    margin-right: 12px;
    transform: scale(1.3);
}

.answer-label.selected {
    border-color: #1a73e8;
    background-color: #e8f0fe;
}

.answer-label.correct {
    border-color: #28a745;
    background-color: #d4edda;
}

.answer-label.incorrect {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.answer-label.missed {
    border-color: #ffc107;
    background-color: #fff3cd;
}

/* Explication */
.explanation-box {
    margin-top: 20px;
    padding: 20px;
    background-color: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 0 8px 8px 0;
}

.explanation-box h4 {
    margin-top: 0;
    color: #1a73e8;
}

.explanation-box textarea {
    width: 100%;
    min-height: 100px;
    margin-top: 10px;
}

/* Stats */
.stats-box {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    min-width: 150px;
}

.stat-item .number {
    font-size: 2rem;
    font-weight: bold;
}

.stat-item .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* File upload */
.file-upload {
    border: 2px dashed #ddd;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: #1a73e8;
    background-color: #f8f9fa;
}

.file-upload input[type="file"] {
    display: none;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

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

/* QCM List */
.qcm-list {
    display: grid;
    gap: 15px;
}

.qcm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s;
}

.qcm-item:hover {
    background: #e8f0fe;
}

.qcm-item h3 {
    margin: 0;
    color: #333;
}

.qcm-item .qcm-info {
    color: #666;
    font-size: 0.9rem;
}

/* Progress bar */
.progress-bar {
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header nav a {
        margin: 5px;
    }

    .stats-box {
        justify-content: center;
    }

    .nav-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .nav-buttons .btn {
        width: 100%;
    }
}
