/**
 * Styles pour le Quiz OVM Forms
 */

/* Variables CSS */
:root {
    --ovm-primary-color: #4a5568;
    --ovm-success-color: #4CAF50;
    --ovm-error-color: #f44336;
    --ovm-bg-light: #f7fafc;
    --ovm-border-color: #e2e8f0;
    --ovm-text-dark: #2d3748;
    --ovm-text-light: #718096;
    --ovm-radius: 8px;
    --ovm-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Wrapper principal */
.ovm-quiz-wrapper {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 40px 20px;
    position: relative;
}

.ovm-quiz-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.ovm-quiz-container {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header du quiz */
.ovm-quiz-header {
    background: var(--ovm-primary-color);
    color: white;
    padding: 40px;
    border-radius: var(--ovm-radius) var(--ovm-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ovm-quiz-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.ovm-quiz-icon {
    width: 100px;
    height: 100px;
   
    border-radius: 50%;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ovm-quiz-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ovm-quiz-title {
    margin: 0;
    color:white;
    font-size: 32px;
    font-weight: 700;
}

.ovm-quiz-tagline {
    margin: 10px 0 0 0;
    font-size: 16px;
    opacity: 0.9;
}

.ovm-quiz-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ovm-quiz-menu-btn span {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Score Banner */
.ovm-quiz-score-banner {
    background: var(--ovm-bg-light);
    padding: 20px 40px;
    border-bottom: 2px solid var(--ovm-border-color);
    font-size: 18px;
    font-weight: 600;
    color: var(--ovm-text-dark);
}

/* Formulaire du quiz */
.ovm-quiz-form {
    background: white;
    border-radius: 0 0 var(--ovm-radius) var(--ovm-radius);
    overflow: hidden;
}

.ovm-quiz-questions {
    padding: 40px;
}
/* Cacher le footer sur les pages de quiz */
body.quiz-template-default #footer {
    display: none !important;
}

/* Barre de progression fixe */
.ovm-quiz-progress-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ovm-quiz-progress-fixed .ovm-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--ovm-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.ovm-quiz-progress-fixed .ovm-progress-fill {
    height: 100%;
    background: var(--ovm-success-color);
    transition: width 0.3s ease;
    width: 0%;
}

.ovm-quiz-progress-fixed .ovm-progress-text {
    font-size: 14px;
    color: var(--ovm-text-dark);
    font-weight: 600;
    white-space: nowrap;
}

/* Ajuster le contenu pour ne pas être caché par la barre fixe */
.ovm-quiz-form {
    padding-top: 0;
}

.ovm-quiz-questions {
    padding-top: 40px;
}

.ovm-quiz-navigation {
    padding-bottom: 100px;
    margin-bottom: 0;
}

/* Questions - Toutes visibles */
.ovm-quiz-question {
    display: block;
    margin-bottom: 30px;
    animation: fadeIn 0.4s ease-in-out;
}

.ovm-quiz-question.ovm-question-reviewed {
    display: block;
    margin-bottom: 40px;
    border: 2px solid var(--ovm-border-color);
    border-radius: var(--ovm-radius);
    padding: 30px;
    position: relative;
}

.ovm-quiz-question.ovm-correct {
    background: #f0fdf4;
    border-color: var(--ovm-success-color);
}

.ovm-quiz-question.ovm-incorrect {
    background: #fef2f2;
    border-color: var(--ovm-error-color);
}

.ovm-question-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.ovm-status-text {
    font-size: 16px;
}

.ovm-status-correct {
    color: var(--ovm-success-color);
}

.ovm-status-incorrect {
    color: var(--ovm-error-color);
}

.ovm-question-points {
    margin-left: auto;
    background: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.ovm-question-number {
    width: 40px;
    height: 40px;
    background: var(--ovm-primary-color);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 20px;
}

.ovm-question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--ovm-text-dark);
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Média de la question */
.ovm-question-media {
    margin: 20px 0;
    background: white;
    border-radius: var(--ovm-radius);
    overflow: hidden;
    box-shadow: var(--ovm-shadow);
}

/* Image */
.ovm-question-media.ovm-media-image img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 600px;
    margin: 0 auto;
}

/* Vidéo de la médiathèque */
.ovm-question-media.ovm-media-video video {
    width: 100%;
    height: auto;
    display: block;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--ovm-radius);
}

/* Vidéo externe (iframe) */
.ovm-question-media.ovm-media-video-external iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

/* Support pour les embeds WordPress (oembed) */
.ovm-question-media iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive pour les vidéos */
@media (max-width: 768px) {
    .ovm-question-media.ovm-media-video video,
    .ovm-question-media.ovm-media-video-external iframe,
    .ovm-question-media iframe {
        max-width: 100%;
    }
}

/* Réponses */
.ovm-question-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.ovm-answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--ovm-bg-light);
    border: 2px solid var(--ovm-border-color);
    border-radius: var(--ovm-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.ovm-answer-option:hover {
    border-color: var(--ovm-primary-color);
    background: #edf2f7;
}

.ovm-answer-option input[type="radio"],
.ovm-answer-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--ovm-primary-color);
}

.ovm-answer-text {
    flex: 1;
    font-size: 16px;
    color: var(--ovm-text-dark);
}

/* Réponses en mode correction */
.ovm-answer-disabled {
    cursor: default;
    pointer-events: none;
}

.ovm-answer-correct-selected {
    background: #dcfce7;
    border-color: var(--ovm-success-color);
}

.ovm-answer-incorrect-selected {
    background: #fee2e2;
    border-color: var(--ovm-error-color);
}

.ovm-answer-correct-not-selected {
    background: #f0fdf4;
    border-color: #86efac;
}

.ovm-answer-icon {
    flex-shrink: 0;
}

.ovm-answer-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ovm-border-color);
    border-radius: 50%;
    flex-shrink: 0;
}

.ovm-answer-radio.ovm-correct-indicator {
    border-color: var(--ovm-success-color);
    background: var(--ovm-success-color);
    position: relative;
}

.ovm-answer-radio.ovm-correct-indicator::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* Navigation */
.ovm-quiz-navigation {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 40px 40px 30px;
    border-top: 2px solid var(--ovm-border-color);
    margin-top: 20px;
}

.ovm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--ovm-radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.ovm-btn-primary {
    background: var(--ovm-primary-color);
    color: white;
}

.ovm-btn-primary:hover {
    background: #2d3748;
    transform: translateY(-2px);
    box-shadow: var(--ovm-shadow);
}

.ovm-btn-secondary {
    background: transparent;
    color: var(--ovm-primary-color);
    border: 2px solid var(--ovm-primary-color);
}

.ovm-btn-secondary:hover {
    background: var(--ovm-primary-color);
    color: white;
}

.ovm-btn-submit {
    background: var(--ovm-success-color)!important;
    color: #fff;
    font-size: 18px;
    padding: 16px 40px;
}

.ovm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Page de remerciement */
.ovm-quiz-thankyou {
    background: white;
    padding: 60px 40px;
    border-radius: 0 0 var(--ovm-radius) var(--ovm-radius);
    text-align: center;
}

.ovm-score-display {
    margin-bottom: 40px;
}

.ovm-score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
}

.ovm-score-circle svg {
    width: 100%;
    height: 100%;
}

.ovm-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ovm-score-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--ovm-text-dark);
}

.ovm-score-percentage {
    font-size: 20px;
    color: var(--ovm-text-light);
    margin-top: 5px;
}

.ovm-result-message {
    max-width: 600px;
    margin: 0 auto 40px;
}

.ovm-result-message h2 {
    font-size: 28px;
    color: var(--ovm-text-dark);
    margin-bottom: 16px;
}

.ovm-result-message p {
    font-size: 18px;
    color: var(--ovm-text-light);
    line-height: 1.6;
}

.ovm-quiz-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Page de correction */
.ovm-quiz-correction-content {
    background: white;
    padding: 40px;
}

/* Commentaire de correction */
.ovm-correction-comment {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-left: 4px solid var(--ovm-primary-color);
    border-radius: var(--ovm-radius);
}

.ovm-comment-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--ovm-primary-color);
}

.ovm-comment-content {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ovm-text-dark);
}

.ovm-comment-content p {
    margin: 0 0 10px 0;
}

.ovm-comment-content p:last-child {
    margin-bottom: 0;
}

.ovm-comment-content strong {
    color: var(--ovm-primary-color);
}

.ovm-comment-content ul,
.ovm-comment-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.ovm-comment-content li {
    margin-bottom: 5px;
}

.ovm-correction-actions {
    background: white;
    padding: 40px;
    border-radius: 0 0 var(--ovm-radius) var(--ovm-radius);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ovm-quiz-wrapper {
        padding: 20px 10px;
    }
    
    .ovm-quiz-header {
        padding: 30px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .ovm-quiz-header-content {
        flex-direction: column;
    }
    
    .ovm-quiz-title {
        font-size: 24px;
    }
    
    .ovm-quiz-icon {
        width: 60px;
        height: 60px;
    }
    
    .ovm-quiz-progress-fixed {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ovm-quiz-progress-fixed .ovm-progress-text {
        text-align: center;
        font-size: 12px;
    }
    
    .ovm-quiz-navigation {
        padding-bottom: 120px;
    }
    
    .ovm-quiz-questions,
    .ovm-quiz-thankyou,
    .ovm-quiz-correction-content {
        padding: 30px 20px;
    }
    
    .ovm-quiz-navigation {
        flex-direction: column;
        padding: 20px;
    }
    
    .ovm-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ovm-quiz-actions {
        flex-direction: column;
    }
    
    .ovm-score-circle {
        width: 150px;
        height: 150px;
    }
    
    .ovm-score-number {
        font-size: 28px;
    }
}

/* Loading state */
.ovm-quiz-loading {
    text-align: center;
    padding: 40px;
}

.ovm-quiz-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--ovm-border-color);
    border-top-color: var(--ovm-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
