/* Reset container styles */
.iq-checker-container {
    all: initial;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;

    /* Define custom properties */
    --iq-primary-color: #5050ff;
    --iq-text-color: #333;
    --iq-bg-color: #fff;
    --iq-border-color: #ddd;
    --iq-spacing: 20px;
    --iq-spacing-small: 8px;
    --iq-border-radius: 5px;
}

/* Reset all elements inside container */
.iq-checker-container * {
    all: unset;
    box-sizing: border-box;
}

/* Restore basic elements behavior */
.iq-checker-container {
    display: block;
    width: 100%;
    margin: 0 auto;
    padding: var(--iq-spacing) 0;
    background: var(--iq-bg-color);
    color: var(--iq-text-color);
}

/* Typography */
.iq-checker-container h2,
.iq-checker-container h3 {
    display: block;
    margin: 0 0 var(--iq-spacing) 0;
    font-weight: bold;
    line-height: 1.4;
}

.iq-checker-container h2 {
    font-size: 24px;
}

.iq-checker-container h3 {
    font-size: 18px;
}

.iq-checker-container p {
    display: block;
    margin: 0 0 var(--iq-spacing-small) 0;
    line-height: 1.6;
}

.iq-checker-container p:last-child {
    margin-bottom: 0;
}

.iq-checker-container strong {
    font-weight: bold;
}

/* Timer and Progress Bar styles */
.iq-checker-intro {
    display: block;
    margin-bottom: var(--iq-spacing);
    padding: var(--iq-spacing);
    background: #f9f9f9;
    border-radius: var(--iq-border-radius);
    border: 1px solid var(--iq-border-color);
}

.iq-checker-timer {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: var(--iq-spacing) 0;
}

[role="progressbar"] {
    --percentage: var(--value);
    --primary: var(--iq-primary-color);
    --secondary: #ddd;
    --size: 100px;
    animation: progress 2s 0.5s forwards;
    width: var(--size);
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

[role="progressbar"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(var(--primary) calc(var(--percentage) * 1%), var(--secondary) 0);
    mask: radial-gradient(white 55%, transparent 0);
    mask-mode: alpha;
    -webkit-mask: radial-gradient(#0000 55%, #000 0);
    -webkit-mask-mode: alpha;
}

[role="progressbar"]::after {
    counter-reset: percentage var(--value);
    content: counter(percentage) '%';
    font-family: Helvetica, Arial, sans-serif;
    font-size: calc(var(--size) / 5);
    color: var(--primary);
}

/* Question section styling */
.iq-checker-question {
    display: block;
    margin-bottom: var(--iq-spacing);
    padding: var(--iq-spacing);
    background: #f9f9f9;
    border-radius: var(--iq-border-radius);
    border: 1px solid var(--iq-border-color);
}

/* Answer options styling */
.iq-checker-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: var(--iq-spacing);
}

.iq-checker-answer {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Checkbox styling to look like radio */
.iq-checker-answer input[type="checkbox"] {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--iq-border-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-right: 0px !important;
}

.iq-checker-answer input[type="checkbox"]:checked {
    border-color: var(--iq-primary-color);
}

.iq-checker-answer input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--iq-primary-color);
    border-radius: 50%;
}

.iq-checker-answer label {
    display: inline-block;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.4;
    flex: 1;
}

/* Image question specific styles */
.image-question-container {
    margin-top: var(--iq-spacing);
}

.image-question-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: var(--iq-spacing);
}

/* Password section styling */
.iq-checker-password-section {
    margin-top: var(--iq-spacing);
    padding: var(--iq-spacing);
    background: #f9f9f9;
    border-radius: var(--iq-border-radius);
    border: 1px solid var(--iq-border-color);
}

.iq-password-instruction {
    margin-bottom: var(--iq-spacing);
}

.iq-checker-password {
    margin: 20px 0px 10px 0px;
    border-radius: var(--iq-border-radius);
    display: block;
}

.iq-checker-password label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Submit button styling */
.iq-checker-submit {
    margin-top: var(--iq-spacing);
    text-align: center;
}

.iq-submit-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--iq-primary-color);
    color: white;
    border-radius: var(--iq-border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    min-width: 200px;
    text-align: center;
}

.iq-submit-button:hover {
    background-color: #4040cc;
}

/* Error and warning states */
.iq-question-unchecked {
    border-color: #dc3545;
}

.iq-warning-text {
    color: #dc3545;
    margin-top: 12px;
    font-size: 14px;
    display: block;
}

/* Animation for validation shake */
@keyframes iq-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.iq-shake {
    animation: iq-shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .iq-checker-container {
        padding: var(--iq-spacing) var(--iq-spacing-small);
    }

    .iq-checker-question,
    .iq-checker-intro,
    .iq-checker-result {
        padding: var(--iq-spacing-small);
    }

    .iq-submit-button {
        width: 100%;
    }
}

/* Heading styles */
.iq-checker-heading {
    font-size: 28px;
    text-align: center;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    font-weight: 700;
    color: var(--iq-primary-color);
}

/* Image question styles */
.image-question-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.iq-checker-question .image-question-container>img {
    aspect-ratio: 1;
    width: 400px;
    border: 1.5px solid var(--iq-border-color);
    border-radius: 4px;
}

.iq-checker-image-answers {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 360px;
    gap: 30px;
}

.iq-checker-image-answers input[type="checkbox"] {
    display: none;
}

.iq-checker-image-answers input[type="checkbox"]+label {
    width: 100px;
    height: auto;
    cursor: pointer;
}

.iq-checker-image-answers input[type="checkbox"]+label img {
    border: 1.5px solid var(--iq-border-color);
    border-radius: 4px;
    width: 100%;
    aspect-ratio: 1;
}

.iq-checker-image-answers input[type="checkbox"]:checked+label img {
    border: 1.5px solid var(--iq-primary-color);
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .iq-checker-heading {
        font-size: 24px;
        margin: 0 0 14px 0;
    }

    .image-question-container {
        flex-direction: column;
        gap: 20px;
    }

    .iq-checker-question .image-question-container>img {
        width: 100%;
    }

    .iq-checker-image-answers {
        width: 100%;
        gap: 16px;
    }

    .iq-checker-image-answers input[type="checkbox"]+label {
        width: calc((100% - 32px) / 3);
    }
}

/* Result section styling */
.iq-checker-result {
    display: none;
    margin-bottom: var(--iq-spacing);
    padding: var(--iq-spacing);
    background: #f9f9f9;
    border-radius: var(--iq-border-radius);
    border: 1px solid var(--iq-border-color);
}

.iq-checker-result h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--iq-primary-color);
}

.iq-result-content {
    text-align: center;
}

#iq-checker-result {
    font-size: 48px;
    font-weight: bold;
    color: var(--iq-primary-color);
    margin-bottom: 20px;
}

#iq-checker-result-text {
    margin-top: 20px;
}

.iq-checker-result-text-item {
    display: none;
    font-size: 16px;
    line-height: 1.6;
    color: var(--iq-text-color);
    margin-bottom: 10px;
}

/* Password section styling */
.iq-checker-password-section {
    margin-top: var(--iq-spacing);
    padding: var(--iq-spacing);
    background: #f9f9f9;
    border-radius: var(--iq-border-radius);
    border: 1px solid var(--iq-border-color);
}

.iq-password-instruction {
    margin-bottom: var(--iq-spacing);
}

.iq-checker-password {
    margin: 20px 0px 10px 0px;
    border-radius: var(--iq-border-radius);
    display: block;
}

.iq-checker-password label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.iq-checker-password input {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid var(--iq-border-color);
    border-radius: var(--iq-border-radius);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .iq-submit-button {
        width: 100%;
    }

    .iq-checker-result,
    .iq-checker-password-section {
        padding: var(--iq-spacing-small);
    }

    #iq-checker-result {
        font-size: 36px;
    }
}