main {
    font-family: 'Rubik', sans-serif;
    max-width: 85%;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    color: #002B5B;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    font-weight: 700;
}

h3 {
    color: #002B5B;
    margin-top: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Quiz Creation Form */
.quiz-form {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 8px rgba(0, 43, 91, 0.08);
    border: 1px solid #E5E7EB;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.875rem;
    font-weight: 600;
    color: #002B5B;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.975rem;
    font-family: 'Rubik', sans-serif;
    background-color: white;
    color: #1F2937;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00B4D8;
    background-color: white;
}

.form-group select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.975rem;
    font-family: 'Rubik', sans-serif;
    background-color: white;
    color: #1F2937;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002B5B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 20px;
    padding-right: 2.5rem;
}

.form-group select:focus {
    outline: none;
    border-color: #00B4D8;
    background-color: white;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.question-group label {
    display: block;
    margin-bottom: 0.875rem;
    font-weight: 600;
    color: #002B5B;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.question-group input[type="text"],
.question-group input[type="number"],
.question-group textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.975rem;
    font-family: 'Rubik', sans-serif;
    background-color: white;
    color: #1F2937;
}

.question-group input[type="text"]:focus,
.question-group input[type="number"]:focus,
.question-group textarea:focus {
    outline: none;
    border-color: #00B4D8;
    background-color: white;
}

.question-group select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.975rem;
    font-family: 'Rubik', sans-serif;
    background-color: white;
    color: #1F2937;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23002B5B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 20px;
    padding-right: 2.5rem;
}

.question-group select:focus {
    outline: none;
    border-color: #00B4D8;
    background-color: white;
}

.question-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.question {
    background: white;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    border-left: 5px solid #00B4D8;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 43, 91, 0.05);
}

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

.question-header h3 {
    margin: 0;
    color: #002B5B;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.question-group {
    margin-bottom: 1.5rem;
}

.options-container {
    margin-bottom: 1.5rem;
}

.answer-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.answer-item input[type="text"] {
    flex: 1;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
    font-size: 0.975rem;
    background-color: white;
    color: #1F2937;
}

.answer-item input[type="text"]:focus {
    outline: none;
    border-color: #00B4D8;
    background: white;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 500;
    color: #002B5B;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    margin: 0 !important;
}

.checkbox-label span {
    display: inline;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #00B4D8;
    flex-shrink: 0;
    vertical-align: middle;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 500;
    color: #002B5B;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    margin: 0 !important;
}

.radio-label span {
    display: inline;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #00B4D8;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-remove {
    background: #ef4444;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn-remove:hover {
    background-color: #dc2626;
}

.btn-remove svg {
    width: 14px;
    height: 14px;
}

.btn-remove-small {
    background: #ef4444;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.375rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.btn-remove-small:hover {
    background-color: #dc2626;
}

.btn-remove-small svg {
    width: 12px;
    height: 12px;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #E5E7EB;
    justify-content: flex-end;
}

.form-actions button {
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Rubik', sans-serif;
}

.btn-secondary {
    background-color: #E5E7EB;
    color: #002B5B;
    border: 1px solid #D1D5DB;
}

.btn-secondary:hover {
    background-color: #D1D5DB;
    border-color: #B4BAC0;
}

.btn-success {
    background-color: #00B4D8;
    color: white;
    border: 1px solid #00B4D8;
}

.btn-success:hover {
    background-color: #0093B0;
    border-color: #0093B0;
}

/* fenetre de l'aperçu */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.preview-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.preview-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.preview-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-modal-close:hover {
    color: #002B5B;
}

#preview-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.btn-info {
    background-color: #0891b2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.btn-info:hover {
    background-color: #0e7490;
}


.quiz-header {
    background: linear-gradient(135deg, #002B5B 0%, #00B4D8 100%);
    color: white;
    padding: 1.75rem 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 8px rgba(0, 43, 91, 0.1);
}

.quiz-header h1 {
    color: white !important;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.quiz-header p {
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
}


.quiz-score-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 2rem;
    border: 1px solid #E5E7EB;
}

.quiz-score-card h2 {
    margin: 0;
    color: #002B5B;
    font-size: 2rem;
    font-weight: 700;
}

.quiz-score-card p {
    margin: 0.25rem 0 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.question-container {
    background: white;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.question-container strong {
    font-size: 0.95rem;
    color: #002B5B;
}

.user-answer-display {
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.qcm-options {
    margin-top: 1rem;
}

.qcm-options p {
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #002B5B;
    font-size: 0.9rem;
}

.qcm-option {
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    font-size: 0.9rem;
}

.qcm-option input[type="radio"] {
    margin-right: 0.75rem;
    cursor: default;
}

.qcm-option-text {
    flex-grow: 1;
    color: #1F2937;
}

.qcm-option.selected-correct {
    background: #d1fae5;
    border-color: #a7f3d0;
}

.qcm-option.selected-incorrect {
    background: #fee2e2;
    border-color: #fecaca;
}

.qcm-option.correct-not-selected {
    background: #fef3c7;
    border-color: #fde68a;
}

.qcm-option-result {
    font-weight: 600;
    margin-left: auto;
    padding-left: 0.75rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qcm-option-result svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.qcm-option-result.correct {
    color: #059669;
}

.qcm-option-result.correct svg path {
    fill: #059669;
}

.qcm-option-result.incorrect {
    color: #dc2626;
}

.qcm-option-result.incorrect svg path {
    fill: #dc2626;
}

.text-answer-section {
    margin-top: 0.75rem;
    background: white;
    color: #6b7280;
    font-size: 0.9rem;
}

.text-answer-section p {
    margin: 0.5rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.text-answer-content {
    color: #1F2937;
    margin: 0.25rem 0;
}

.keywords {
    color: #059669;
    font-weight: 600;
}

.keywords-list {
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-item {
    color: #6b7280;
}

.keyword-matched {
    font-weight: 700;
    color: #059669;
}

/* Liste des quiz dans cours.php*/
.quizzes-list-container {
    margin: 2rem 0;
}

.quiz-empty-message {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.quiz-item-card {
    background: #f9f9f9;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.quiz-item-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #002B5B;
}

.quiz-item-card p {
    margin: 0.5rem 0 1rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.quiz-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-meta p {
    margin: 0;
}

.question-count {
    font-size: 0.85rem;
    color: #00B4D8;
    font-weight: 600;
    display: inline-block;
}

.quiz-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.quiz-actions-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quiz-btn {
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s ease;
    border: none;
    cursor: pointer;
}

.quiz-btn:hover {
    opacity: 0.9;
}

.quiz-btn-success {
    background-color: #4ADE80;
}

.quiz-btn-warning {
    background-color: #ffc107;
    color: black;
}

.quiz-btn-warning svg {
    width: 14px;
    height: 14px;
    margin-right: 0.3rem;
}

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

.quiz-btn-primary {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
}

.quiz-btn-add {
    display: inline-block;
    margin-top: 0.5rem;
}

.add-quiz-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 2rem 1rem;
}

.quiz-btn-add-large {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.quiz-btn-add-large:hover {
    opacity: 0.9;
}

.quiz-btn-delete {
    padding: 0.5rem;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.quiz-btn-delete svg {
    width: 18px;
    height: 18px;
}

.quiz-main-solve {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.quiz-header-content {
    flex: 1;
}

.quiz-header-title {
    margin: 0;
    color: #002B5B;
    font-size: 2rem;
}

.quiz-header-desc {
    margin: 0.75rem 0 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

.question-container-solve {
    background: white;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 43, 91, 0.05);
}

.question-statement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-statement-text {
    font-size: 1rem;
}

.question-points-badge {
    color: #6b7280;
    font-size: 0.85rem;
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.quiz-solve-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.qcm-option-label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.qcm-option-label:hover {
    background-color: #f8fafc;
}

.qcm-option-input {
    margin-right: 0.75rem;
    cursor: pointer;
}

.quiz-actions-row {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-quiz-submit {
    flex: 1;
    padding: 0.875rem;
}

.result-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-points-text {
    color: #6b7280;
    font-size: 0.9rem;
}

.user-answer-text {
    color: #1F2937;
}

.text-answer-label {
    margin-bottom: 0.75rem;
}

.text-answer-box {
    margin-bottom: 1rem;
}

.accepted-answers-title {
    margin: 1rem 0 0.75rem 0;
}

.preview-title-section {
    margin: 0;
    color: #002B5B;
}

.preview-sidebar {
    position: sticky;
    top: 32px;
}

@media (max-width: 1100px) {
    main {
        max-width: 100%;
        margin: 1rem auto;
        padding: 0 1.25rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .quiz-form {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .preview-sidebar {
        position: static;
        margin-top: 2rem;
    }
}
