/* ===================================
   QUIZ DETAIL - STYLES
   Fichier: quiz-detail.css
   Description: Styles pour la page de quiz détaillé
   Note: Utilise les variables CSS définies dans main.css
   =================================== */

body {
    padding-top: 80px;
    padding-bottom: 80px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- QUIZ CONTAINER --- */
.main-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-bottom: 60px;
}

.quiz-card {
    background: var(--bg-white);
    width: 100%;
    max-width: 680px;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- QUIZ HEADER --- */
.q-header {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.q-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.q-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.q-category {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.q-title-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-bottom: 12px;
}

.q-title-main::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--cyan);
    border-radius: 2px;
}

.level-badge {
    background: var(--cyan);
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.q-timer {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.q-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.progress-pill {
    background: #E2E8F0;
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan-dark) 100%);
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- QUIZ BODY --- */
.q-body {
    padding: 32px 28px;
    flex: 1;
}

.q-question-block {
    margin-bottom: 28px;
}

.q-text {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-main);
    font-weight: 500;
}

/* --- OPTIONS --- */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.option-btn:hover:not(.disabled) {
    border-color: var(--cyan);
    background: #FDFDFD;
}

/* État sélectionné (avant validation) */
.option-btn.selected {
    background: #E0F2FE;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.option-btn.selected .opt-key {
    background: var(--cyan);
    color: white;
}

.opt-key {
    width: 28px;
    height: 28px;
    background: #F1F5F9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: 0.2s;
}

/* ÉTATS RÉPONSE */
.option-btn.correct {
    background: var(--cyan-light);
    border-color: var(--cyan);
    color: var(--text-main);
}

.option-btn.correct .opt-key {
    background: var(--cyan);
    color: var(--text-main);
}

.option-btn.wrong {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger-text);
}

.option-btn.wrong .opt-key {
    background: var(--danger);
    color: white;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- FEEDBACK PANEL --- */
.feedback-panel {
    margin-top: 24px;
    padding: 20px;
    border-radius: 12px;
    display: none;
    animation: slideDownFade 0.3s ease;
}

.feedback-panel.success {
    background: #E0F2FE;
    border: 1px solid var(--cyan);
}

.feedback-panel.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.fb-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1rem;
}

.feedback-panel.success .fb-header {
    color: var(--cyan-dark);
}

.feedback-panel.error .fb-header {
    color: var(--danger-text);
}

.fb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-main);
}

/* --- QUIZ FOOTER --- */
.q-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFBFC;
    height: 72px;
}

.btn-next {
    background: var(--text-main);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-next:hover {
    background: var(--cyan);
    color: var(--text-main);
    transform: translateY(-2px);
}

.btn-quit {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.2s;
}

.btn-quit:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {
    body {
        padding-top: 65px;
        padding-bottom: 20px;
    }

    .main-wrapper {
        padding: 30px 10px;
        margin-bottom: 50px;
    }

    .quiz-card {
        border-radius: 16px;
    }

    /* HEADER */
    .q-header {
        padding: 16px 20px;
    }

    .q-top-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
    }

    .q-category {
        font-size: 0.65rem;
    }

    .q-title-main {
        font-size: 1.1rem;
    }

    .level-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .q-timer {
        font-size: 0.95rem;
        padding: 4px 10px;
        align-self: flex-end;
        margin-top: -8px;
    }

    .progress-label {
        font-size: 0.7rem;
    }

    .progress-pill {
        height: 6px;
    }

    /* BODY */
    .q-body {
        padding: 20px 20px;
    }

    .q-text {
        font-size: 1.1rem;
        line-height: 1.5;
    }

    .q-question-block {
        margin-bottom: 20px;
    }

    /* OPTIONS */
    .options-grid {
        gap: 8px;
    }

    .option-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
        gap: 12px;
    }

    .opt-key {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    /* FEEDBACK */
    .feedback-panel {
        padding: 16px;
        margin-top: 20px;
    }

    .fb-header {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .fb-content {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* FOOTER */
    .q-footer {
        padding: 16px 20px;
        height: auto;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-next {
        width: 100%;
        padding: 14px 24px;
        font-size: 0.9rem;
        justify-content: center;
    }

    .btn-quit {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.85rem;
        text-align: center;
    }

    /* Styles responsive pour le footer (aligné avec main.css) */
    footer {
        padding: 40px 0;
        font-size: 0.85rem;
    }

    footer div:first-child {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    footer a {
        display: block;
        margin: 0 !important;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    body {
        padding-top: 60px;
        padding-bottom: 15px;
    }

    .main-wrapper {
        padding: 25px 10px;
        margin-bottom: 40px;
    }

    .q-title-main {
        font-size: 1rem;
    }

    .q-text {
        font-size: 1rem;
    }

    .option-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .opt-key {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    footer {
        padding: 30px 0;
        font-size: 0.8rem;
    }

    footer div:first-child {
        gap: 10px;
    }

    footer a {
        font-size: 0.8rem;
    }

    footer p {
        font-size: 0.75rem;
        margin-top: 15px;
    }
}
