/*
 * my-quiz-style.css
 *
 * Provides basic styling for the My Simple Quiz Plugin.
 */

/* Basic styling for the main quiz container */
.my-quiz-container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px; /* Rounded corners */
    padding: 20px;
    margin: 20px auto; /* Center the container and add some margin */
    max-width: 600px; /* Limit width for better readability */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: "Inter", sans-serif; /* Use Inter font */
    text-align: center; /* Center content within the quiz container */
}

/* Styling for the question text */
.my-quiz-question {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
}

/* Styling for the quiz image */
.my-quiz-image {
    max-width: 100%; /* Ensure image is responsive */
    height: auto; /* Maintain aspect ratio */
    border-radius: 5px; /* Slightly rounded corners for the image */
    margin-bottom: 20px; /* Space below the image */
    display: block; /* Ensures it takes its own line and respects margin auto */
    margin-left: auto; /* Center image horizontally */
    margin-right: auto; /* Center image horizontally */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}


/* Styling for the options wrapper */
.my-quiz-options {
    margin-bottom: 20px;
    text-align: left; /* Align options text to the left within their container */
}

/* Styling for individual option labels */
.my-quiz-option {
    display: block; /* Each option on a new line */
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px; /* Rounded corners for options */
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex; /* Use flexbox for alignment of radio button and text */
    align-items: center; /* Vertically align items */
}

/* Hover effect for options */
.my-quiz-option:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

/* Style for the radio button input */
.my-quiz-option input[type="radio"] {
    margin-right: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative; /* For custom checked state */
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Checked state for custom radio button */
.my-quiz-option input[type="radio"]:checked {
    background-color: #4CAF50; /* Green for selected radio dot */
    border-color: #4CAF50;
}

.my-quiz-option input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* Styling for the option text */
.my-quiz-option .option-text {
    font-size: 1.1em;
    color: #555;
    flex-grow: 1; /* Allow text to take remaining space */
}

/* Styling for correct option selection */
.my-quiz-option.correct-option {
    background-color: #d4edda; /* Light green */
    border-color: #155724;
    color: #155724;
}

/* Styling for incorrect option selection */
.my-quiz-option.incorrect-option {
    background-color: #f8d7da; /* Light red */
    border-color: #721c24;
    color: #721c24;
}

/* Highlight correct option when an incorrect one is selected */
.my-quiz-option.highlight-correct {
    border: 2px dashed #4CAF50; /* Dashed green border */
}


/* Styling for the feedback message */
.my-quiz-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px; /* Rounded corners */
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

/* Styling for general correct feedback (text) */
.my-quiz-feedback.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Styling for general incorrect feedback (text) */
.my-quiz-feedback.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Styling for the explanation text - Hidden by default, takes no space */
.my-quiz-explanation {
    max-height: 0; /* NEW: Collapse height to 0 */
    overflow: hidden; /* NEW: Hide overflow content */
    opacity: 0; /* NEW: Make it transparent */
    padding: 0 10px; /* NEW: Remove vertical padding when hidden */
    margin-top: 0; /* NEW: Remove top margin when hidden */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out, margin-top 0.3s ease-out; /* Smooth transition */

    /* Default styles when shown (will be applied by .show-explanation) */
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 0.95em;
    color: #495057;
    text-align: left;
}

/* NEW: Class to show the explanation */
.my-quiz-explanation.show-explanation {
    max-height: 200px; /* Arbitrary height, needs to be large enough for content */
    opacity: 1;
    padding: 10px; /* Restore padding */
    margin-top: 10px; /* Restore margin */
    /* If you have very long explanations, adjust max-height accordingly */
}


/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .my-quiz-container {
        margin: 10px auto;
        padding: 15px;
    }
    .my-quiz-question {
        font-size: 1.3em;
    }
    .my-quiz-option {
        padding: 10px 12px;
    }
}
