/**
 * CaniGuide – Quiz "Quel chien est fait pour moi ?"
 * CSS OPTIMISÉ - Desktop et Mobile
 */

/* ============================================================
   STRUCTURE GLOBALE
============================================================ */
.quiz-wrapper {
    width: 100%;
    background: #f9f9f9;
    padding: 40px 20px 60px;
}

.quiz-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ============================================================
   INTRODUCTION
============================================================ */
.quiz-intro,
.quiz-step {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.quiz-intro {
    padding: 50px 40px;
    text-align: center;
}

.quiz-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 20px;
}

.quiz-description {
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.5;
}

/* ============================================================
   BOUTONS COMMUNS
============================================================ */
.btn-quiz-start,
.btn-quiz-next,
.btn-quiz-prev,
.btn-view-race,
.btn-quiz-restart,
.btn-show-more {
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    padding: 12px 24px;
    font-size: 1rem;
    transition: all 0.25s ease;
    border: none;
}

/* Bouton "Commencer le quiz" - Version imposante */
.btn-quiz-start {
    background: #EA7D1F;
    color: #ffffff;
    padding: 16px 48px;
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-quiz-start:hover {
    background: #d06d1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 125, 31, 0.4);
}

/* Boutons primaires (orange) */
.btn-quiz-next,
.btn-quiz-restart,
.btn-show-more {
    background: #EA7D1F;
    color: #ffffff;
}

.btn-quiz-next:hover:not(:disabled),
.btn-quiz-restart:hover,
.btn-show-more:hover {
    background: #d06d1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 125, 31, 0.3);
}

.btn-quiz-next:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Bouton précédent */
.btn-quiz-prev {
    background: #f5f5f5;
    color: #452D16;
    border: 2px solid #e0e0e0;
}

.btn-quiz-prev:hover:not(:disabled) {
    background: #ebebeb;
    border-color: #d0d0d0;
}

.btn-quiz-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton "Voir la fiche" */
.btn-view-race {
    background: #EA7D1F;
    color: #ffffff;
    text-decoration: none;
    display: inline-block;
    margin-top: 12px;
    width: 100%;
    text-align: center;
}

.btn-view-race:hover {
    background: #d06d1a;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 125, 31, 0.3);
}

/* ============================================================
   QUESTIONS
============================================================ */
.quiz-step {
    padding: 30px;
    margin-bottom: 30px;
}

.quiz-question {
    font-size: 1.4rem;
    font-weight: 700;
    color: #452D16;
    text-align: center;
    margin-bottom: 30px;
}

.quiz-question-hint {
    font-size: 0.85rem;
    color: #777;
    font-weight: 400;
    margin-top: 6px;
}

/* ============================================================
   OPTIONS
============================================================ */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quiz-option {
    padding: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.quiz-option:active {
    transform: scale(0.98);
}

.quiz-option.selected {
    border-color: #EA7D1F !important;
    background: rgba(234,125,31,0.15) !important;
    box-shadow: 0 2px 8px rgba(234, 125, 31, 0.2);
}

/* Hover uniquement en desktop, pas sur mobile pour éviter les états fantômes */
@media (hover: hover) and (pointer: fine) {
    .quiz-option:hover:not(.selected) {
        border-color: #EA7D1F;
        background: rgba(234,125,31,0.08);
    }
}

/* ============================================================
   ACTIONS (BOUTONS NAVIGATION)
============================================================ */
.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

/* Wrapper "Ignorer" */
.quiz-skip-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quiz-skip {
    background: transparent;
    border: 1.5px dashed #bbb;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #777;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-skip:hover {
    border-color: #999;
    color: #555;
    background: rgba(0,0,0,0.02);
}

.quiz-skip-hint {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
}

/* ============================================================
   PROGRESSION
============================================================ */
.quiz-progress-wrapper {
    margin-bottom: 25px;
}

.quiz-progress-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
}

.quiz-progress {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: #EA7D1F;
    transition: width 0.3s ease;
}

/* ============================================================
   HISTORIQUE
============================================================ */
.quiz-profile-toggle {
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 14px 18px;
    font-weight: 700;
    margin-bottom: 15px;
    cursor: pointer;
    border-radius: 8px;
    width: 100%;
    transition: all 0.2s ease;
}

.quiz-profile-toggle:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.quiz-profile {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px 22px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-bottom: 40px;
}

.quiz-profile ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-profile li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.quiz-profile li:last-child {
    border-bottom: none;
}

.quiz-profile strong {
    color: #452D16;
    flex: 0 0 auto;
}

.quiz-profile span {
    color: #666;
    text-align: right;
    flex: 1 1 auto;
}

/* ============================================================
   RÉSULTATS
============================================================ */
.quiz-results-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 25px;
}

.quiz-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.quiz-result-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quiz-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.quiz-result-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.quiz-result-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.quiz-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 8px;
}

.quiz-result-score {
    font-size: 1.05rem;
    font-weight: 700;
    color: #EA7D1F;
    margin-bottom: 16px;
}

/* ============================================================
   SHOW MORE & RESTART
============================================================ */
.quiz-show-more-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.quiz-hidden {
    margin-top: 0 !important;
}

.btn-quiz-restart {
    display: block;
    margin: 40px auto 0;
}

/* ============================================================
   MOBILE (CORRECTIONS IMPORTANTES)
============================================================ */
@media (max-width: 768px) {
    .quiz-wrapper {
        padding: 20px 15px 40px;
    }

    .quiz-intro,
    .quiz-step {
        padding: 25px 20px;
    }

    .quiz-title {
        font-size: 1.6rem;
    }

    .quiz-question {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    /* OPTIONS: une seule colonne en mobile */
    .quiz-options {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    /* PADDING EN BAS DU STEP pour éviter que le contenu soit caché par la barre sticky */
    .quiz-step {
        padding-bottom: 180px;
    }

    /* ACTIONS: barre sticky en bas */
    .quiz-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        padding: 15px 20px;
        z-index: 100;
        
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 0;
    }

    .quiz-actions button,
    .quiz-skip-wrapper {
        width: 100%;
    }

    /* Wrapper "Ignorer" reste en colonne pour clarté */
    .quiz-skip-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    /* Ordre: Suivant en premier (visible), puis Précédent, puis Ignorer */
    .btn-quiz-next {
        order: 1;
    }

    .btn-quiz-prev {
        order: 2;
    }

    .quiz-skip-wrapper {
        order: 3;
    }

    /* Résultats */
    .quiz-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .quiz-result-card img {
        height: 160px;
    }

    /* Profil */
    .quiz-profile li {
        flex-direction: column;
        gap: 5px;
    }

    .quiz-profile span {
        text-align: left;
    }
	
	.quiz-description .cg-readmore-toggle,
    .quiz-description .read-more,
    .quiz-description a {
        display: block;
        margin-bottom: 15px;
    }

    .btn-quiz-start {
        display: block;
        margin: 0 auto;
    }
}

/* ============================================================
   TRÈS PETITS ÉCRANS
============================================================ */
@media (max-width: 480px) {
    .quiz-step {
        padding: 20px 15px;
    }

    .quiz-question {
        font-size: 1.1rem;
    }

    .btn-quiz-start,
    .btn-quiz-next,
    .btn-quiz-prev,
    .btn-view-race {
        font-size: 0.95rem;
        padding: 11px 20px;
    }
}