/* exam_style.css */

/* General Exam Container */
.exam-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    max-width: 900px; /* Adjust width as needed */
    width: 100%;
    margin: 20px auto;
}

/* Progress Bar Enhancements */
.progress-bar-container {
    margin-bottom: 2rem; /* Space below progress area */
    height: auto; /* Allow space for text */
    background-color: transparent;
    box-shadow: none;
    padding: 5px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #555;
    padding: 0 5px; /* Align text slightly */
}

#progressText {
    font-weight: bold;
}

#currentItemType {
    font-style: italic;
    color: #006064; /* Teal color */
}

/* Container for the visual bar */
.progress-bar-visual {
    width: 100%;
    height: 12px; /* Bar thickness */
    background-color: #e9ecef; /* Light grey background */
    border-radius: 6px;
    overflow: hidden; /* Clip the inner bar */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Subtle inner shadow */
}

/* The actual moving progress bar */
.progress-bar-container .progress-bar { /* More specific selector */
    height: 100%;
    width: 0%; /* Starts at 0% */
    background: linear-gradient(to right, #28a745, #218838); /* Green gradient */
    border-radius: 6px;
    transition: width 0.5s ease-in-out; /* Smooth width transition */
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5); /* Optional glow effect */
    display: block; /* Ensure it's visible */
}


/* Ensure Passage Area is hidden/shown correctly */
#passageArea {
    margin-bottom: 25px; /* Space below passage */
}
#passageArea.hidden {
    display: none;
}

/* Style for the passage topic heading */
#passageTopic {
    text-align: center;
    font-weight: bold;
    margin-bottom: 1.5em;
    font-size: 1.2em;
    color: #222222;
    line-height: 1.4;
}
/* Style for the passage text block */
#passageText {
    background-color: #f8f9fa;
    padding: 20px 25px;
    border-left: 5px solid #76c7c0; /* Teal left border */
    line-height: 1.75;
    color: #222222;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
#passageText br { /* Add visual space for line breaks */
    content: "";
    display: block;
    margin-bottom: 0.6em;
}

/* Visual Aid styling */
.visual-aid-container {
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    background-color: #fdfdfd; /* Slightly off-white */
    border-radius: 5px;
    border: 1px solid #eee;
}
.visual-aid-container.hidden {
    display: none;
}
.visual-aid-container img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}


/* Questions Header styling */
#questionsHeader {
    color: #006064;
    margin-bottom: 20px;
    margin-top: 30px;
    font-size: 1.4em;
    padding-bottom: 10px;
    border-bottom: 2px solid #76c7c0; /* Teal underline */
}

/* Individual Question Block styling (inherits from style.css) */
.question-block {
    margin-bottom: 35px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.question-block:last-child {
     margin-bottom: 20px;
}
.question-text {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #34495e;
    line-height: 1.5;
}
.question-text > strong { /* Styling for PBQ number */
     margin-right: 5px;
}
.question-text > span { /* Style for the actual question content */
     font-weight: normal;
}
/* Choice list styling (inherits from style.css) */
.question-block .choices {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.question-block .choice-item {
    margin-bottom: 10px;
}
/* Choice button styling (inherits from style.css) */

.question-block .choice-button.selected {
    /* Use styles defined in style.css */
     border-color: #007bff;
     background-color: #e7f3ff;
}
/* Feedback/Explanation styling (inherits from style.css) */

.question-block .feedback-area.visible,
.question-block .explanation-area.visible {
    opacity: 1;
    max-height: 500px; /* Ensure enough height */
}



/* Exam Controls Area */
.exam-controls {
    text-align: right; /* Align buttons right */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0; /* Separator line */
}

#submitExamBtn, #nextItemBtn {
    padding: 12px 30px;
    font-size: 1.05em;
    font-weight: 500;
    border-radius: 25px; /* Pill shape */
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    color: white;
    min-width: 160px; /* Ensure decent button width */
    margin-left: 10px; /* Space between buttons if both shown */
}
#submitExamBtn {
     background-color: #28a745; /* Green for submit */
}
#submitExamBtn:hover:not(:disabled) {
    background-color: #218838; /* Darker green */
}
#submitExamBtn:disabled {
    background-color: #bdc3c7; /* Grey when disabled */
    cursor: not-allowed;
    opacity: 0.7;
}
#nextItemBtn {
    background-color: #007bff; /* Blue for next */
}
#nextItemBtn:hover:not(:disabled) {
    background-color: #0056b3; /* Darker blue */
}
/* Utility class to hide elements */
.hidden {
    display: none !important;
}


/* Completion Screen Adjustments */
.completion-screen {
    /* Use styles from style.css */
     text-align: center;
     padding: 40px 30px;
     background-color: #e0f2f1; /* Light teal */
     border-radius: 8px;
     margin-top: 30px;
     border: 1px solid #b2dfdb;
}

.results-summary, .results-breakdown {
    margin-bottom: 25px;
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.results-summary h3, .results-breakdown h3 {
    color: #006064;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}
#overallScore {
    font-weight: bold;
    color: #198754; /* Green for score */
    font-size: 1.2em; /* Slightly larger */
}
.results-scaled-score {
    margin-top: 35px; /* Add space above the new section */
    margin-bottom: 25px;
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.results-scaled-score h3 {
    color: #006064;
    margin-bottom: 15px; /* Adjusted margin */
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}
.chart-container {
    margin-bottom: 20px;
    min-height: 300px; /* Ensure space for chart */
}
#categoryScoresList {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 400px; /* Limit width of text list */
    text-align: left;
}
#categoryScoresList li {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.95em;
}
#categoryScoresList li:last-child {
    border-bottom: none;
}
.completion-controls {
    margin-top: 30px;
    display: flex;
    justify-content: space-between; /* Pushes buttons apart */
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 10px;
}
.completion-controls button { /* Use styles from style.css */
     background-color: #00796b;
     color: white;
     padding: 12px 25px;
     border: none;
     border-radius: 6px;
     cursor: pointer;
     font-size: 1em;
     font-weight: 500;
     margin: 5px; /* Adjust margin for wrapping */
     transition: background-color 0.2s ease, transform 0.1s ease;
     min-width: 160px; /* Ensure minimum width */
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}



/* Responsive Adjustments (Combine/Refine from style.css and exam_style.css) */
@media (max-width: 768px) {
    .exam-container {
        padding: 20px 25px;
    }
}

@media (max-width: 650px) {
    .exam-container {
        padding: 20px 15px;
    }
    .completion-controls {
         flex-direction: column-reverse; /* Stack buttons, Home below Start Again */
         gap: 15px;
         align-items: center; /* Center stacked buttons */
     }
     .completion-controls button {
         width: 90%; /* Make buttons wider when stacked */
         margin: 5px auto; /* Center buttons */
         min-width: 0; /* Allow full width */
     }
    .progress-info {
        font-size: 0.85em; /* Slightly smaller text */
    }
     #submitExamBtn, #nextItemBtn {
        padding: 10px 20px;
        font-size: 1em;
        min-width: 140px;
    }
}

@media (max-width: 450px) {
     body { padding: 10px 5px; } /* Less padding on very small screens */
    .exam-container {
        padding: 15px 10px;
    }
    h1 { font-size: 1.3em; }
    .question-text { font-size: 1em; }
    .question-block .choice-button { font-size: 0.95em; padding: 10px 12px; }
     #submitExamBtn, #nextItemBtn { padding: 9px 18px; font-size: 0.95em; min-width: 120px; }
     .completion-screen h2 { font-size: 1.6em; }
     .completion-screen p { font-size: 1.1em; }
     .completion-controls button { font-size: 0.95em; padding: 10px 20px; width: 95%; }
}

/* Ensure loading indicator is centered */
.loading-indicator {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    padding: 60px 0; /* More vertical padding */
}


