/*importing Google Fonts*/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    /* outline: 1px solid red; */
}

body {
    background: #8657F9;
}

@media only screen and (max-width: 600px) {
    .quiz_box .title {
        display: none;
    }
}

.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.sound-toggle button {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
}


.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.container {
    background: #fff;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.container h1 {
    font-size: 24px;
    color: #520CF7;
    font-weight: 600;
    margin-bottom: 20px;
}

form#quiz-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

form#quiz-form label {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    text-align: left;
}

form#quiz-form input[type="text"],
form#quiz-form input[type="file"],
form#quiz-form input[type="number"],
form#quiz-form select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #333;
    border: 1px solid #c5abfc;
    border-radius: 5px;
    background: #f9f9ff;
}

form#quiz-form input[type="text"]:focus,
form#quiz-form input[type="file"]:focus,
form#quiz-form input[type="number"]:focus,
form#quiz-form select:focus {
    outline: none;
    border-color: #520CF7;
    box-shadow: 0 0 5px rgba(82, 12, 247, 0.5);
}

form#quiz-form select {
    appearance: none;
    /* For consistent dropdown styling across browsers */
    cursor: pointer;
}

form#quiz-form input[type="number"] {
    -moz-appearance: textfield;
    /* Hide spinners for Firefox */
}

form#quiz-form input[type="number"]::-webkit-inner-spin-button,
form#quiz-form input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    /* Hide spinners for Chrome */
}

#quiz-output {
    margin-top: 30px;
    display: none;
}

#quiz-output h2 {
    font-size: 20px;
    color: #8657F9;
    font-weight: 600;
    margin-bottom: 15px;
}

#quiz-questions {
    text-align: left;
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

#quiz-results {
    margin-top: 30px;
    font-size: 16px;
    color: #520CF7;
}

.info_box,
.quiz_box,
.result_box {
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
}

.info_box,
.result_box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.start_btn button {
    font-size: 25px;
    font-weight: 500;

    padding: 15px 30px;
    outline: none;
    border: none;
    border-radius: 5px;

    cursor: pointer;
    transition: all 0.3s ease;

    margin-top: 10px;
    width: 100%;

    border: 3px solid #8657F9;
    color: white;
    background: #8657F9;
}

.start_btn button:hover {

    border: 3px solid #8657F9;
    background: white;
    color: #8657F9;
}


.info_box {
    display: none;
    width: 540px;
    background: #fff;
    border-radius: 5px;
}

.info_box .info_title {
    height: 60px;
    width: 100%;
    border-bottom: 1px solid lightgrey;
    display: flex;
    align-items: center;
    padding: 0 35px;
    font-size: 20px;
    font-weight: 600;
}

.info_box .info_list {
    padding: 15px 35px;
}

.info_box .info_list .info {
    margin: 5px 0;
    font-size: 17px;
}

.info_box .buttons {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 35px;
    border-top: 1px solid lightgrey;
}

.info_box .buttons button {
    margin: 0 5px;
    height: 40px;
    width: 400px;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.buttons button.restart {
    color: #fff;
    background: #8657F9;
}

.buttons button.restart:hover {
    background: #520CF7;
}

.buttons button.quit {
    color: #8657F9;
}

.buttons button.quit:hover {
    color: #fff;
    background: #8657F9;
}

.quiz_box {
    background: #fff;
    width: 90%;
    max-width: 600px;
    position: absolute;
    /* Enables positioning */
    top: 50%;
    /* Centers vertically */
    left: 50%;
    /* Centers horizontally */
    transform: translate(-50%, -50%);
    /* Adjusts for the element's size */
    border-radius: 10px;
    padding: 30px;
    display: none;
}

.quiz_box header {
    display: flex;
    /* Enables flexbox layout */
    justify-content: space-between;
    /* Aligns items to the ends */
    align-items: center;
    /* Vertically centers items */
    /*border-bottom: 1px solid #333;*/
    padding-bottom: 20px;
    /* Adjust spacing as needed */
}

.quiz_box .title {
    font-size: 30px;
    color: #520CF7;
    font-weight: 600;
}

.quiz_box .timer {
    display: flex;
    align-items: center;
    /* Center the text horizontally */
    justify-content: space-between;
    font-size: 15px;
    /* Adjust size as needed */
    font-weight: 500;
    width: 145px;
    height: 45px;
    color: #333;
    background: #d5c2ff;
    border: 1px solid #c5abfc;
    border-radius: 5px;
    padding: 0 8px;
    user-select: none;
}

.quiz_box .timer .timer_sec {
    font-size: 18px;
    font-weight: 500;
    background: #34079e;
    height: 30px;
    width: 45px;
    color: #fff;
    text-align: center;
    line-height: 30px;
    border-radius: 5px;
    border: 1px solid #34079e;
}

.quiz_box .progress-bar-container {
    width: 100%;
    height: 5px;
    /* Thickness of the progress bar */
    background: #e0e0e0;
    /* Background color for the empty bar */
    margin: 10px 0;
    /* Spacing between the header and question text */
    position: relative;
}

.quiz_box .progress-bar {
    width: 100%;
    /* Start with full width */
    height: 100%;
    /* Match the container's height */
    background: #520CF7;
    /* Progress bar color */
    transition: width 1s linear;
    /* Smoothly shrink width over time */
}

.quiz_box .ques_text {
    font-size: 18px;
    color: #520CF7;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
}

.answer-buttons {
    display: flex;
    flex-direction: column;
    /* Default layout: Column */
    gap: 10px;
    /* Add vertical spacing between buttons */
    align-items: stretch;
    /* Buttons take full width */
}

.answer-buttons.grid-layout {
    flex-direction: row;
    /* Switch to grid for two answers */
    flex-wrap: wrap;
    /* Allow wrapping for the grid */
    justify-content: center;
    /* Center-align for the grid */
    gap: 10px;
    /* Add spacing for grid layout */
}

.answer-buttons .btn {
    width: 100%;
    /* Default: Full width for column layout */
    max-width: 600px;
    /* Optional: Set a max width for consistency */
    background: #fff;
    color: #222;
    font-weight: 500;
    border: 1px solid #180446;
    padding: 10px;
    margin: 0;
    /* Remove default margin for uniform alignment */
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    /* Ensure buttons are block elements */
}

.answer-buttons .btn.selected {
    background: #520CF7;
    /* Highlight selected buttons */
    color: #fff;
    /* Change text color for visibility */
}

.answer-buttons.grid-layout .btn {
    flex: 1 1 calc(50% - 10px);
    /* Each button takes up 50% width minus spacing */
    max-width: 200px;
    /* Limit the size in grid mode */
}

.answer-buttons .btn.disabled {
    cursor: default;
    /* Remove pointer cursor */
    pointer-events: none;
    /* Disable hover and click interactions */
    transition: none;
    /* Disable hover transitions */
    background: #ddd;
    /* Optional: Indicate the button is disabled */
}

/* Normal Button Styling */
.quiz_box .btn {
    background: #fff;
    color: #222;
    font-weight: 500;
    width: 100%;
    border: 1px solid #180446;
    padding: 10px;
    margin: 5px 0;
    text-align: left;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

/* Hover Effect */
.quiz_box .btn:hover {
    background: #180446;
    color: #fff;
}

/* Disable Hover and Click Effects for Answered Buttons */
.quiz_box .btn.answered {
    cursor: default;
    /* Remove pointer cursor */
    pointer-events: none;
    /* Disable hover and click interactions */
    transition: none;
    /* Disable transition effects */
}

.quiz_box .next {
    background: #180446;
    color: #fff;
    font-weight: 500;
    width: 150px;
    border: 0;
    padding: 10px;
    margin: 20px auto 0;
    border-radius: 4px;
    cursor: pointer;
    display: none;
}

.result_box {
    display: none;
    /*Hidden by default */
    background: #fff;
    width: 90%;
    max-width: 540px;
    margin: -10px auto;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.3);
    /* Matches shadow style */
    text-align: center;
}

.result_box .result_title {
    font-size: 24px;
    color: #520CF7;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid lightgrey;
    padding-bottom: 10px;
}

.result_box .result_content {
    font-size: 18px;
    color: #333;
    margin: 20px 0;
}

.result_box .result_content span {
    color: #520CF7;
    font-weight: 600;
}

.result_box .buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.result_box .buttons button {
    background: #8657F9;
    color: #fff;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result_box .buttons button:hover {
    background: #520CF7;
}

.result_box .result_percentage {
    font-size: 30px;
    color: #520CF7;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Circular Progress Bar Container */
.progress-circle {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 0 auto 20px;
    /* Center the circle and add spacing */
}

.progress-circle .circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#e0e0e0 0%, #e0e0e0 100%);
    /* Default gray background */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-90deg);
    /* Start gradient at the top */
}

.progress-circle .circle::before {
    content: '';
    position: absolute;
    width: 85%;
    /* Inner white circle */
    height: 85%;
    background: #fff;
    border-radius: 50%;
    z-index: 1;
    /* Place above the gradient */
}

.progress-circle .percentage {
    font-size: 24px;
    font-weight: 700;
    color: #520CF7;
    position: absolute;
    z-index: 2;
    /* Place above the inner circle */
    text-align: center;
    transform: rotate(90deg);
    /* Counter-rotate text to keep it upright */
}

.explanation-container {
    background: #f9f9ff;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid #d5c2ff;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

.explanation-container h3 {
    font-size: 18px;
    color: #520CF7;
    font-weight: 600;
    margin-bottom: 10px;
}

.explanation-container p {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}