body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f4f8;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.mcq-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #0b4f94;
    margin-bottom: 25px;
    font-size: 1.6em;
}

.passage {
    background-color: #eaf2f8;
    border-left: 5px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 5px;
}
.passage h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2980b9;
    font-size: 1.2em;
}
.passage p {
    line-height: 1.7;
    color: #555;
}

.question-area {
    margin-bottom: 20px;
}
.question {
    font-weight: 600;
    font-size: 1.15em;
    margin-bottom: 20px;
    color: #34495e;
}

.choices {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-bottom: 25px; /* Space before submit button */
}
.choice-item {
    margin-bottom: 12px;
}

.choice-button {
    display: flex;
    align-items: baseline;
    width: 100%;
    padding: 12px 15px;
    font-size: 1em;
    text-align: left;
    background-color: #fdfdfd;
    border: 2px solid #dce4ec;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
    color: #333;
    font-family: inherit;
}
.choice-button:hover {
    background-color: #e8f0f6;
    border-color: #a9cce3;
}
.choice-button:active {
    transform: scale(0.99);
}
.choice-letter {
    font-weight: bold;
    margin-right: 10px;
    color: #3498db;
    flex-shrink: 0;
}

/* Style for the selected choice *before* submitting */
.choice-button.selected {
    border-color: #3498db; /* Highlight border */
    background-color: #eaf2f8; /* Slight background change */
    border-width: 3px;
}

/* Controls area styling */
.controls {
    text-align: center;
    margin-top: 15px;
}
/* Specific style for initial submit button container */
.controls.initial-submit {
    margin-bottom: 20px;
}

/* Style for the final controls container (Rating + Next Button) */
.controls.final-controls {
    display: flex;
    justify-content: space-between; /* Pushes items to edges */
    align-items: center; /* Vertically aligns items */
    margin-top: 25px; /* More space before final controls */
    padding-top: 15px;
    border-top: 1px solid #e0e0e0; /* Separator line */
}


/* Submit and Next Button Styles */
#submitBtn, #nextBtn {
    padding: 12px 30px;
    font-size: 1.05em;
    font-weight: 500;
    border-radius: 25px; /* Pill shape */
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

#submitBtn {
    background-color: #2ecc71; /* Green */
    color: white;
}
#submitBtn:hover {
    background-color: #27ae60;
}
#submitBtn:disabled {
    background-color: #bdc3c7; /* Greyed out */
    cursor: not-allowed;
    opacity: 0.7;
}

#nextBtn {
    background-color: #3498db; /* Blue */
    color: white;
}
#nextBtn:hover {
    background-color: #2980b9;
}


/* --- Feedback & Explanation Styles --- */
.feedback-area, .explanation-area {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    transition: opacity 0.5s ease, max-height 0.5s ease; /* Smooth appearance */
    opacity: 0; /* Hidden by default via opacity */
    max-height: 0; /* Hidden by default via height */
    overflow: hidden; /* Needed for max-height transition */
}

.feedback-area.visible, .explanation-area.visible {
    opacity: 1;
    max-height: 500px; /* Set a large enough max-height */
}


.feedback-area {
    font-weight: 600;
    font-size: 1.1em;
}
.feedback-area.correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.feedback-area.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.explanation-area {
    background-color: #e8f0f6;
    color: #34495e;
    border: 1px solid #d6eaf8;
    margin-top: 15px; /* Space below feedback */
    text-align: left;
    line-height: 1.6;
}

/* --- Star Rating Styles --- */
.rating-area {
    display: flex;
    align-items: center;
    gap: 5px; /* Space between label and stars */
}
.rating-area > span:first-child { /* Style for "Rate this question:" text */
     margin-right: 8px;
     font-size: 0.95em;
     color: #555;
}
.star {
    font-size: 1.8em; /* Adjust star size */
    color: #dcdcdc; /* Default empty star color */
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none; /* Prevent text selection */
    /* If using Font Awesome, adjust font-size and color */
}
.star:hover,
.star.hover { /* Hover state (applied by JS) */
    color: #ffc107; /* Yellow/Gold hover */
}
.star.selected { /* Selected state (applied by JS) */
     color: #ff9800; /* Orange selected */
}


/* Style for choice buttons *after* submit */
.choice-button.correct-final {
    background-color: #c8e6c9 !important; /* Use important to override hover/selected */
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
    cursor: default;
    opacity: 1 !important;
}
.choice-button.correct-final .choice-letter {
    color: #1b5e20 !important;
}

.choice-button.incorrect-final {
    background-color: #ffcdd2 !important;
    border-color: #f44336 !important;
    color: #c62828 !important;
    cursor: default;
    opacity: 0.7 !important; /* Slightly faded */
}
.choice-button.incorrect-final .choice-letter {
    color: #b71c1c !important;
}

.choice-button:disabled:not(.correct-final):not(.incorrect-final) {
     /* Style for non-selected, disabled choices */
    opacity: 0.6;
    cursor: default;
    background-color: #f8f9f9;
}


/* Utility class */
.hidden {
    display: none !important;
}