.tf-quiz-wrapper {
    width: 65%;
    margin: 0 auto;
    background: #e9e9e9;
}

.tf-quiz-question {
    border-bottom: 1px solid #eee;
}

.tf-quiz-question:last-child {
    border-bottom: none;
}

.tf-quiz-question-label {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tf-quiz-question-number {
    display:none;
    position: absolute;
    font-weight: 600;
    margin-right: 6px;
}

.tf-quiz-question-text {
    font-weight: 500;
    padding: 6rem 3rem 2rem;
    text-align: center;
    justify-content: center;
    display: flex;
    width: 100%;
}

.tf-quiz-question-image {
    object-position: center;
    object-fit: cover;
    object-position: top;
    width: 100%;
    aspect-ratio: 1.5/1;
    height: auto;
    display: block;
}

.tf-quiz-answers label {
    margin-right: 16px;
    cursor: pointer;
}

.tf-quiz-feedback {
    font-size: 0.9em;
    font-weight: 600;
    margin: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 1rem;
}

.tf-quiz-feedback.correct{
    background: #59e1ab;
}

.tf-quiz-feedback.incorrect{
    color: #d4002d;
    background: #e3cecf;
}

.tf-quiz-stats {
    margin-top: 4px;
    font-size: 0.85em;
    color: #555;
}

.tf-quiz-submit-button {
    margin-top: 12px;
}

.tf-quiz-overall-result {
    font-weight: 700;
    min-height: 30rem;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    width:100%;
}

.tf-quiz-question-image-preview {
    max-width: 80px;
    height: auto;
    display: block;
    margin-bottom: 4px;
}

.tf-quiz-no-image {
    font-size: 12px;
    color: #666;
}

/* Only show active question */
.tf-quiz-question {
    display: none;
}

.tf-quiz-question.tf-quiz-question-active {
    display: block;
}

.tf-quiz-controls {
    margin: 1rem;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tf-quiz-next-button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.tf-quiz-overall-result {
    position: relative;
    margin-top: 12px;
    font-weight: 700;
}

/* Summary styling */
.tf-quiz-summary-score {
    font-weight: 700;
    margin-bottom: 8px;
}

.tf-quiz-summary-headline {
    margin: 0 0 4px;
    font-weight: 600;
}

.tf-quiz-summary-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

.tf-quiz-summary-list li {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.tf-quiz-summary-question-text {
    font-weight: 500;
}

.tf-quiz-summary-your-answer {
    display: inline-block;
    margin-top: 2px;
}

.tf-quiz-summary-stats {
    display: inline-block;
    margin-top: 2px;
    color: #555;
}

/* Reset default radios */
.tf-quiz-answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Container layout */
.tf-quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem;
}

/* Button style */
.tf-quiz-answer-option {
    display: block;
    width: 100%;
    background: #f0f0f0;
    border: 2px solid #ddd;
    padding: 14px 16px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: 0.15s ease;
}

/* Hover */
.tf-quiz-answer-option:hover {
    background: #e5e5e5;
}

/* When selected */
.tf-quiz-answer-option input[type="radio"]:checked + span {
    font-weight: 700;
}

.tf-quiz-answer-option input[type="radio"]:checked ~ span,
.tf-quiz-answer-option input[type="radio"]:checked + span {
    color: white;
}

.tf-quiz-answer-option input[type="radio"]:checked::before {
    display: none;
}

.tf-quiz-answer-option input[type="radio"]:checked + span {
    color: #fff;
}

.tf-quiz-answer-option input[type="radio"]:checked + span,
.tf-quiz-answer-option input[type="radio"]:checked ~ span {
    background: none;
}

/* Change the whole button background when selected */
.tf-quiz-answer-option input[type="radio"]:checked:not(:disabled) + span,
.tf-quiz-answer-option input[type="radio"]:checked ~ span {
    color: #fff;
}

.tf-quiz-answer-option:has(input[type="radio"]:checked) {
    background: black;
    border-color: black;
    color: white;
}

/* Disabled state (after answering) */
.tf-quiz-answer-option.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.tf-quiz-answer-text {
    display: block;
}

.tf-quiz-answer-stats {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    opacity: 0.85;
}

.tf-quiz-progress {
    display:flex;
    position: absolute;
    padding: 1rem;
    width: 100%;
    align-items: center;
}

.tf-quiz-progress-text {
    font-size: 0.9rem;
    background: #e9e9e9;
    padding: 0.25rem .5rem;
    margin: 0 0 0 1rem;
    border-radius: .25rem;
    display: block;
    text-wrap-mode: nowrap;
    width: fit-content;
}

.tf-quiz-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
}

.tf-quiz-progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #007cba;
    transition: width 0.2s ease-out;
}

.tf-quiz-form{
    position: relative;
}