#d2c-quiz {
    padding: 1em;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 8px;

    /* Variables */
    --color-dark-blue: #273044;
    --color-blue: #2c75e4;
    --color-yellow: rgb(234, 184, 48);
}

#d2c-quiz .d2c-quiz-intro {
    text-align: center;
}

.d2c-quiz-intro img {
    max-width: 100%;
    height: auto;
}

.d2c-quiz-title {
    padding: 0;
    margin: 2rem auto 1rem;
    display: block;
    text-align: center;
}

#d2c-quiz .d2c-quiz-box {
    text-align: left;
    margin-bottom: 1em;
}

#d2c-quiz button {
    padding: 1.2em 2.2em;
    background-color: var(--color-blue);
    border-radius: 30px;
    text-transform: uppercase;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
}


/* Quiz tile */

.d2c-quiz-tile {
    display: flex;
    flex-direction: column;
}

.d2c-quiz-tile__image,
.d2c-quiz-tile__content {
    width: 100%;
}

.d2c-quiz-tile__image img {
    width: 100%;
    height: auto;
}

.d2c-quiz-tile__content {
    padding-top: 0.5em;
    margin-top: 1em;
    border-top: 1px solid #ccc;
}


.d2c-quiz-choices,
.d2c-explanation-choices {
    list-style: none;
    padding: 0;
    margin: 1em 0;
}

.d2c-quiz-choices {
    max-width: 200px;
}

.d2c-quiz-answer-box,
.d2c-quiz-explanation-box {
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 0.5em;
    position: relative;
    overflow:hidden
}

.d2c-quiz-answer-box {
    cursor: pointer;
}


.d2c-quiz-answer-box::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    line-height: 1em;
    border: 1px solid #ccc;
}

.d2c-explanations-title {
    margin: 2em 0 -1em 0;
    text-align: center;

}

.d2c-quiz-answer-box.d2c-chosen,
.d2c-quiz-explanation-box.d2c-chosen {
    
    box-shadow: 0 0 10px rgba(0,0,0, 0.15);
}

.d2c-quiz-answer-box.d2c-chosen::before {
    background-color: var(--color-yellow);
    border-color: var(--color-yellow);
}


.d2c-quiz-question,
.d2c-explanation-description {
    font-weight: bold;
    margin-bottom: 0.5em;
}

.d2c-quiz-question {
    margin-top: 1.5em;
}

.d2c-quiz-alert {
    padding: 0 0.5em;
    border-radius: 20px;
    margin-left: 3px;
    color: #d51a59;
    font-weight: bold;
}

.d2c-quiz-results {
   padding: 2em 1em;
    background-color: rgb(237, 248, 251);
    display: none;
}

.d2c-quiz-results h3 {
    margin-top: 0;
}

.d2c-quiz-results span,
span.d2c-explanations-title {
    display: block;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--color-blue);
}


.d2c-quiz-results h3,
.d2c-quiz-results span {
    text-align: center;
}


.d2c-explanation-description {
    margin-top: 1em;
}


.d2c-explanation {
    margin-top: 1em;
    margin-left: auto;
    margin-right: auto;
    border: 2px solid var(--color-yellow);
    padding: 0.5em 1em;
    border-radius: 3px;
}

.d2c-explanation:first-of-type {
    border-color: transparent;
    margin-top: 1em;
}

.d2c-explanation-image {

   display: flex;
    align-items: center;
    justify-content: center;
    gap: .25em;
    flex-wrap: wrap;
}

.d2c-explanation-image img {
    max-width: 100px;
    height: auto;
}


.d2c-quiz-explanation-box::before {
    content: "1";
    position: absolute;
    font-size: 2.5em;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
}

.d2c-quiz-explanation-box.d2c-chosen::before {
    color: var(--color-yellow);
}

.d2c-quiz-explanation-box:nth-of-type(2)::before {
    content: "2";
}

.d2c-quiz-explanation-box:nth-of-type(3)::before {
    content: "3";
}

.d2c-restart-area {
    max-width: 700px;
    margin: 2em auto; 
    border-top: 1px solid #ccc;
    text-align: center;
    padding-top: 1em;
}


/* Progress bar */

#d2c-progress {

    margin-bottom: 2em;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}


.d2c-progress-indicator-wrap {
    border: 1px solid #ccc;
    padding: 2px;
    border-radius: 15px;
    margin-top: 3px;
}

.d2c-progress-indicator {
    position: relative;
    width: 260px;
    height: 8px;
    overflow: hidden;
    border-radius: 15px;
}

.d2c-progress-info {
    font-size: 0.7em;
    color: #666;
}

.d2c-progress-indicator::after {
    transition: width 0.25s ease-in-out;
    position: absolute;
    content: "";
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: var(--color-yellow);
    border-radius: 25px;
}

.d2c-progress-1 .d2c-progress-indicator::after {
    width: calc(100%/6);
}
.d2c-progress-2 .d2c-progress-indicator::after {
    width: calc(2* 100%/6);
}
.d2c-progress-3 .d2c-progress-indicator::after {
    width: calc(3 * 100%/6);
}
.d2c-progress-4 .d2c-progress-indicator::after {
    width: calc(4 * 100%/6);
}
.d2c-progress-5 .d2c-progress-indicator::after {
    width: calc(5 * 100%/6);
}
.d2c-progress-6 .d2c-progress-indicator::after {
    width: calc(6 * 100%/6);
}


/* Quiz images */
#d2c-images {
    display: grid;
    align-items: center;
    grid-template-columns: repeat(1, 1fr);
    gap: 5px;
    margin-bottom: 1em;
}

#d2c-images img {
    max-width: 100%;
    height: auto;
}

.d2c-copyright-info {
    font-size: 0.8em;
    color: #666;
    margin-top: 1em;
}

.d2c-copyright-images {
    margin-top: 1em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.d2c-copyright-images img {
    width: 200px;
    margin: 0.5em;
}

/* Responsiveness */

@media (min-width: 768px) {
    #d2c-quiz {
       padding:1.5em;
    }
    
    .d2c-quiz-tile__content {
        width: 100%;
        max-width: 600px;
    }

    .d2c-quiz-question {
        margin-top: 0;
    }

    #d2c-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

