body {
    font-family: sans-serif;
    margin: 0; /* Remove default body margin */
    background-color: #f4f4f4;
    color: #333;
    padding-top: 0; /* Will be adjusted by JS if needed, or by fixed header's height */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
}

/* Common style for control groups within specific areas */
.controls {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* Global controls always at the bottom */
.global-controls {
    border-top: 1px solid #eee; /* Optional separator */
    padding-top: 15px;
}

#assessment-list {
    margin-top: 20px;
}

.assessment-button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    text-align: left;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.assessment-button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.assessment-button:active {
    transform: translateY(0);
}

/* NEW: Styles for student/teacher selection elements */
.selection-group {
    margin-bottom: 15px;
}

.selection-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.selection-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
}

.selection-group select:disabled {
    background-color: #eee;
    cursor: not-allowed;
    opacity: 0.7;
}


#assessment-area {
    margin-top: 20px;
    border: 1px solid #ddd;
    padding: 20px; /* Initial padding, will be adjusted by top-controls-fixed height */
    border-radius: 5px;
    line-height: 1.8;
    font-size: 1.2em;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    background-color: #fdfdfd;
    position: relative; /* Needed for z-index context, if children use absolute positioning */
}

/* NEW: Fixed top controls */
#top-controls-fixed {
    position: sticky; /* Changed from fixed to sticky for better layout within container */
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff; /* Background to cover scrolling content */
    padding: 15px 20px; /* Adjust padding as needed */
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space out timer and buttons */
    z-index: 100; /* Ensure it stays on top */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Subtle shadow */
    margin: -20px -20px 20px -20px; /* Compensate for parent padding */
    border-radius: 8px 8px 0 0;
}

#assessment-area #assessment-title {
    margin-top: 60px; /* Adjust margin to prevent title from being obscured by fixed header */
    padding-top: 15px; /* Add some padding if needed */
}

/* Re-style the timer for top placement */
#top-controls-fixed #timer-display {
    margin: 0; /* Remove auto margins */
    min-width: 120px;
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Adjust top buttons container */
#top-controls-fixed .top-buttons {
    margin-top: 0; /* Remove default margin-top */
    justify-content: flex-end; /* Align buttons to the right within their group */
    flex-grow: 1; /* Allow buttons container to take available space */
}

/* Hide the bottom buttons to avoid redundancy */
.bottom-buttons {
    display: none;
}


#assessment-passage {
    white-space: normal;
    margin-bottom: 20px;
}

.line-wrapper {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    border-radius: 4px;
    padding: 5px;
    transition: background-color 0.2s ease;
}

.line-skipper {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.line-skipper:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

/* Styles for the disabled state of the line skipper */
.line-skipper.disabled-skipper {
    pointer-events: none; /* Prevents click events */
    opacity: 0.5; /* Visually dim it */
    cursor: not-allowed;
    background-color: #e0e0e0;
    border-color: #bbb;
    box-shadow: none;
}


.line-wrapper.skipped-line {
    background-color: #ffe0e0;
    border: 1px dashed #e08080;
}

.line-wrapper.skipped-line .line-skipper {
    background-color: #dc3545;
    color: white;
    border-color: #c82333;
}

.line-wrapper.skipped-line .line-skipper:hover {
    background-color: #c82333;
}

.line-wrapper.skipped-line .line-content {
    color: #888;
    text-decoration: line-through;
}

.line-wrapper.skipped-line .word {
    pointer-events: none;
    background-color: transparent !important;
    text-decoration: line-through;
    font-weight: normal;
    color: #888;
}

.line-wrapper.skipped-line .last-word-read {
    background-color: transparent !important;
    border-bottom: none !important;
}


#assessment-passage .word {
    cursor: pointer;
    padding: 0 2px;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    display: inline-block;
}

#assessment-passage .word:hover {
    background-color: #e0e0e0;
}

.incorrect-word {
    background-color: #ffcccc;
    font-weight: bold;
    color: #cc0000;
}

/* NEW: Style for omitted words */
.omitted-word {
    background-color: #fffacd; /* Light goldenrod yellow */
    text-decoration: line-through;
    font-weight: bold;
    color: #a0522d; /* Sienna or similar dark brown */
}

.self-corrected-word {
    background-color: #ccffcc;
    font-weight: bold;
    color: #008000;
}

.last-word-read {
    background-color: #add8e6;
    border-bottom: 2px solid #00008b;
    font-weight: bold;
    padding-bottom: 0px;
}

.last-word-read.incorrect-word {
    background-color: #add8e6;
    border-bottom-color: #cc0000;
}

.last-word-read.self-corrected-word {
    background-color: #add8e6;
    border-bottom-color: #008000;
}

.last-word-read.omitted-word { /* Ensure last word read styling overrides omitted if both present */
    background-color: #add8e6;
    border-bottom-color: #a0522d; /* Use the omitted color for its border */
}


/* Original timer styling, adjusted for its new parent */
#timer-display {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border: 2px solid #007bff;
    border-radius: 8px;
    background-color: #e9f7ff;
    color: #007bff;
    width: fit-content;
    /* Removed auto margins for flexbox alignment */
    min-width: 120px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#timer-display.low-time {
    background-color: #ffcccc;
    color: #cc0000;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.5; }
}


button { /* Base style for all buttons */
    padding: 10px 15px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    flex-grow: 1;
    max-width: fit-content;
    white-space: nowrap; /* Prevent button text from wrapping */
}

/* Specific button styles - now using common classes for start/stop and mark */
.start-stop-button-common {
    background-color: #28a745;
}

.start-stop-button-common:hover:not(:disabled) {
    background-color: #218838;
}

.start-stop-button-common.stop-mode {
    background-color: #dc3545;
}

.start-stop-button-common.stop-mode:hover:not(:disabled) {
    background-color: #c82333;
}

.mark-last-word-button-common {
    background-color: #007bff;
}

.mark-last-word-button-common:hover:not(:disabled) {
    background-color: #0056b3;
}

.mark-last-word-button-common.active-mark-mode {
    background-color: #ffc107;
    color: #333;
    animation: pulse-orange 1s infinite alternate;
}

@keyframes pulse-orange {
    from {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    to {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

#back-button {
    background-color: #6c757d;
}

#back-button:hover:not(:disabled) {
    background-color: #5a6268;
}

#reset-selection-button {
    background-color: #f0ad4e; /* A distinct color for reset */
}

#reset-selection-button:hover:not(:disabled) {
    background-color: #ec971f;
}

#proceed-to-passage-button {
    background-color: #17a2b8; /* A color for 'proceed' */
}

#proceed-to-passage-button:hover:not(:disabled) {
    background-color: #138496;
}

button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

#assessment-results {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #007bff;
    border-radius: 8px;
    background-color: #e9f7ff;
    text-align: left;
    font-size: 1.1em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#assessment-results h3 {
    margin-top: 0;
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

#assessment-results p {
    margin-bottom: 8px;
}

#assessment-results strong {
    color: #333;
}

/* style.css additions for the new feature */

#session-data-list-area {
    background-color: #e9f4ff; /* Light blue background for distinct area */
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #cce0ff;
}

#session-data-list-area h2 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

#assessed-students-container ul {
    list-style-type: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
}

#assessed-students-container li {
    background-color: #ffffff;
    border: 1px solid #ddd;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); /* Subtle shadow */
    line-height: 1.5; /* Improve readability */
    font-size: 0.95em;
}

#assessed-students-container li strong {
    font-size: 1.1em;
    color: #333;
}

#close-session-data-list-button {
    background-color: #6c757d; /* Gray color for close */
}
#close-session-data-list-button:hover:not(:disabled) {
    background-color: #5a6268;
}

/* Style for the new button in global controls */
#view-session-data-button {
    background-color: #28a745; /* Green color for view */
}
#view-session-data-button:hover:not(:disabled) {
    background-color: #218838;
}


/* NEW: Styles for the User Guide Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 200; /* Sit on top (should be higher than other elements) */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    padding: 20px; /* Add some padding around the modal */
    box-sizing: border-box; /* Include padding in width/height */
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* Auto margin for centering */
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 90%; /* Could be adjusted */
    max-width: 700px; /* Max width for readability */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative; /* For close button positioning */
    overflow-y: auto; /* Enable scrolling for content if it's too long */
    max-height: 90vh; /* Max height to fit viewport */
}

.modal-content h2 {
    margin-top: 0;
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

.modal-content h3 {
    color: #007bff;
    margin-top: 25px;
    margin-bottom: 10px;
}

.modal-content p, .modal-content ul, .modal-content ol {
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 1.05em;
}

.modal-content ul, .modal-content ol {
    padding-left: 25px;
}

.modal-content li {
    margin-bottom: 5px;
}

.modal-content strong {
    color: #333;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}