/* Reset container styles */
.mbti-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 */
    --mbti-primary-color: #3f51b5;
    --mbti-text-color: #333;
    --mbti-bg-color: #fff;
    --mbti-border-color: #ddd;
    --mbti-spacing: 20px;
    --mbti-spacing-small: 8px;
    --mbti-border-radius: 5px;
}

/* Reset all elements inside container */
.mbti-checker-container * {
    all: unset;
    box-sizing: border-box;
}

/* Restore basic elements behavior */
.mbti-checker-container {
    display: block;
    width: 100%;
    margin: 0 auto;
    padding: var(--mbti-spacing) 0;
    background: var(--mbti-bg-color);
    color: var(--mbti-text-color);
}

/* Typography */
.mbti-checker-container h2,
.mbti-checker-container h3 {
    display: block;
    margin: 0 0 var(--mbti-spacing) 0;
    font-weight: bold;
    line-height: 1.4;
}

.mbti-checker-container h2 {
    font-size: 24px;
}

.mbti-checker-container h3 {
    font-size: 18px;
}

.mbti-checker-container p {
    display: block;
    margin: 0 0 var(--mbti-spacing-small) 0;
    line-height: 1.6;
}

.mbti-checker-container p:last-child {
    margin-bottom: 0;
}

.mbti-checker-container strong {
    font-weight: bold;
}

/* Timer and Progress Bar styles */
.mbti-checker-intro {
    display: block;
    margin-bottom: var(--mbti-spacing);
    padding: var(--mbti-spacing);
    background: #f9f9f9;
    border-radius: var(--mbti-border-radius);
    border: 1px solid var(--mbti-border-color);
}

.mbti-checker-timer {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: var(--mbti-spacing) 0;
}

.mbti-checker-progress-wrapper {
    width: 100%; /* Đảm bảo wrapper chiếm toàn bộ chiều rộng có sẵn */
    background-color: #e0e0e0; /* Màu nền của thanh chưa hoàn thành */
    border-radius: 8px; /* Bo tròn các góc của thanh ngang */
    height: 10px; /* Chiều cao của thanh tiến độ */
    margin-top: 20px;
    overflow: hidden; /* Đảm bảo phần trăm tiến trình không tràn ra ngoài */
    margin-bottom: 20px; /* Thêm khoảng cách dưới thanh tiến độ */
}

.mbti-checker-progress-wrapper [role="progressbar"] {
    --value: 0; /* Giá trị mặc định của thanh tiến độ */
    /* Các biến --primary, --secondary, --size, animation không còn cần thiết cho thanh ngang đơn giản */
    /* animation: progress 2s 0.5s forwards; - Nếu bạn muốn animation, hãy giữ lại và điều chỉnh cho thanh ngang */

    width: var(--value, 0%); /* Chiều rộng động theo giá trị tiến trình */
    height: 100%; /* Chiếm toàn bộ chiều cao của wrapper */
    background-color: #4CAF50; /* Màu của thanh tiến độ đã hoàn thành (màu xanh lá) */
    border-radius: 8px; /* Bo tròn các góc của phần tiến độ */
    transition: width 0.5s ease-in-out; /* Hiệu ứng chuyển động mượt mà khi tiến độ thay đổi */

    /* Các thuộc tính tạo hình tròn đã bị loại bỏ hoặc thay đổi */
    aspect-ratio: unset; /* Không còn là hình vuông */
    border-radius: 0; /* Bỏ bo tròn 50% */
    position: relative; /* Giữ lại nếu bạn có nội dung bên trong */
    overflow: hidden; /* Giữ lại để đảm bảo nội dung không tràn */
    display: block; /* Hoặc flex, grid tùy bố cục nhưng block là đủ cho thanh ngang */
    /* place-items: center; - Không cần thiết */
    margin: 0; /* Bỏ căn giữa tự động */
}

/* Question section styling */
.mbti-checker-question {
    display: block;
    margin-bottom: var(--mbti-spacing);
    padding: var(--mbti-spacing);
    background: #f9f9f9;
    border-radius: var(--mbti-border-radius);
    border: 1px solid var(--mbti-border-color);
}
.mbti-checker-question:hover {
    transform: translateY(-3px); /* Slightly lift the card on hover */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); /* Enhance shadow on hover */
}

.mbti-checker-question h3 {
    font-size: 1.4em; /* Slightly larger question text */
    color: #3f51b5; /* A vibrant blue for question headings */
    margin-bottom: 20px; /* More space below the question text */
    font-weight: 600; /* Bolder question text */
    line-height: 1.5; /* Improved readability for questions */
}

/* Answer options styling */
.mbti-checker-answers {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Increased gap between answer choices */
    margin-top: 0; /* Remove top margin, handled by h3's margin-bottom */
}

.mbti-checker-answer {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased space between custom checkbox and label */
    background-color: #f7f7f7; /* Very light grey background for answers */
    border: 1px solid #dcdcdc; /* Subtle border for each answer */
    border-radius: 10px; /* Rounded corners for answer boxes */
    padding: 15px 20px; /* Comfortable padding inside answer boxes */
    cursor: pointer; /* Indicate interactivity */
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mbti-checker-answer:hover {
    background-color: #eef7ff; /* Lighter blue on hover */
    border-color: #99ddff; /* Blue border on hover */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05); /* Soft shadow on hover */
}

/* Checkbox styling to look like radio */
.mbti-checker-answer input[type="checkbox"] {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--mbti-border-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-right: 0px !important;
}

.mbti-checker-answer input[type="checkbox"]:checked {
    border-color: var(--mbti-primary-color);
}

.mbti-checker-answer input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--mbti-primary-color);
    border-radius: 50%;
}

.mbti-checker-answer label {
    display: inline-block;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.4;
    flex: 1;
}

/* Submit button styling */
.mbti-checker-submit {
    margin-top: var(--mbti-spacing);
    text-align: center;
}

.mbti-submit-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--mbti-primary-color);
    color: white;
    border-radius: var(--mbti-border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    min-width: 200px;
}

.mbti-submit-button:hover {
    background-color: #4040cc;
}

/* Error and warning states */
.mbti-question-unchecked {
    border-color: #dc3545;
}

.mbti-warning-text {
    color: #dc3545;
    margin-top: 12px;
    font-size: 14px;
    display: block;
}

/* Animation for validation shake */
@keyframes mbti-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.mbti-shake {
    animation: mbti-shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
}

/* Result section styling */
.mbti-checker-result {
    /* Existing properties, ensuring it's hidden by default and lays out content vertically */
    display: none;
    flex-direction: column; /* Ensure content stacks vertically */
    align-items: center; /* Center items horizontally */

    /* --- New/Changed Styling for the Container --- */
    background-color: #e8f5e9; /* Light, calming green background */
    padding: 30px; /* More generous padding */
    margin-top: 40px; /* More spacing from previous sections */
    border-radius: 15px; /* Softer, more rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); /* Deeper shadow for elevation */
    border: 1px solid #c8e6c9; /* Subtle border for definition */
    text-align: center; /* Center align all text within the result section */
}

.mbti-checker-result h2 {
    font-size: 2.5em; /* Larger, more impactful heading */
    color: #2e7d32; /* Darker green for the main title */
    margin-bottom: 25px; /* More space below the heading */
    font-weight: 700; /* Bold font weight */
    text-transform: uppercase; /* Make heading uppercase for emphasis */
    letter-spacing: 1.5px; /* Add slight letter spacing */
}

.mbti-result-content {
    /* Keep these for stacking, but let the parent handle alignment */
    display: flex;
    flex-direction: column;
    /* align-items: center; - This is now handled by .mbti-checker-result */
    width: 100%; /* Ensure content takes full width within the container */
}

#mbti-checker-result {
    /* --- New/Changed Styling for the MBTI Type Display --- */
    color: #ffffff; /* White text for contrast */
    background: linear-gradient(45deg, #4CAF50, #66BB6A); /* Gradient background for a modern look */
    font-size: 4em; /* Much larger font size for the result type */
    font-weight: 800; /* Extra bold */
    width: 160px; /* Larger circle for the result */
    height: 160px; /* Larger circle for the result */
    border-radius: 50%; /* Ensure it's perfectly round */
    display: flex;
    justify-content: center;
    align-items: center; /* Center text vertically and horizontally */
    line-height: 1; /* Adjust line height for perfect vertical centering */
    margin: 0 auto 30px auto; /* Center the circle and add more bottom margin */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Shadow for depth */
    border: 4px solid #a5d6a7; /* Thicker, lighter green border */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); /* Subtle text shadow for pop */
}

#mbti-checker-result-text {
    /* --- New/Changed Styling for the Result Description --- */
    margin: 0; /* Reset margin from previous styling */
    padding: 0 20px; /* Add some horizontal padding for better readability */
    font-size: 1.15em; /* Slightly larger font size */
    color: #444; /* Darker grey for better contrast */
    line-height: 1.8; /* Increased line height for readability */
    max-width: 600px; /* Limit width for optimal line length */
    margin-left: auto; /* Center the text block */
    margin-right: auto; /* Center the text block */
}

/* Password section styling */
.mbti-checker-password-section {
    margin-top: var(--mbti-spacing);
    padding: var(--mbti-spacing);
    background: #f9f9f9;

    border-radius: var(--mbti-border-radius);
    border: 1px solid var(--mbti-border-color);
}

.mbti-password-instruction {
    margin-bottom: var(--mbti-spacing);
}

.mbti-password-instruction>img{
    max-width: 100%;
    height: auto;
}

.mbti-checker-password {
    margin: 20px 0px 10px 0px;
    border-radius: var(--mbti-border-radius);
    display: block;
}

.mbti-checker-password label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Heading styles */
.mbti-checker-heading {
    font-size: 28px;
    text-align: center;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    font-weight: 700;
    color: var(--mbti-primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mbti-checker-container {
        padding: var(--mbti-spacing) var(--mbti-spacing-small);
    }

    .mbti-checker-question,
    .mbti-checker-intro,
    .mbti-checker-result {
        padding: var(--mbti-spacing-small);
    }

    .mbti-submit-button {
        width: 100%;
    }

    .mbti-checker-result,
    .mbti-checker-password-section {
        padding: var(--mbti-spacing-small);
    }

    #mbti-checker-result {
        font-size: 28px;
        width: 80px;
        height: 80px;
    }

    .mbti-checker-heading {
        font-size: 24px;
        margin: 0 0 14px 0;
    }
}