body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
}
.container {
    max-width: 75%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}

.user-email {
    flex: 1;
    text-align: left;
}

.header h2 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.user-email {
    background-color: #f0f0f0;
    padding: 9px;
    border-radius: 5px;
    font-size: 15px;
}

h1 {
    text-align: center;
    color: #f0873d;
}

h2 {
    text-align: center;
}

input[type="text"],
button,
select {
    display: block;
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

button {
    display: block;
    width: 100%;
    margin: 10px auto;
    background-color: #f0873d;
    color: #fff;
    cursor: pointer;
}

button:hover {
    background-color: #d16f34;
}

select {
    padding: 10px;
    background-color: #f9f9f9;
    cursor: pointer;
}

select:focus {
    border-color: #f0873d;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.35); /* Darker overlay */
    z-index: 10000;
    display: none;
}

.loading-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    animation: loading-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    opacity: 0.95;
}

@keyframes loading-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

/* Comment box styles */
.comment-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    transition: background-color 0.3s, border-color 0.3s;
}
.comment-box:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    cursor: pointer;
}
.from-text {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #777;
    font-size: 12px;
}
.comment-date {
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}
.comment-text {
    font-size: 16px;
}

/* Custom Modal Styles */
/* Common modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%; /* Adjust the width as needed */
    max-width: 60%;
    height: 80%;
    max-height: 80%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

    /* Centering using absolute positioning */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    overflow-y: auto; /* Make modal content scrollable if needed */
}

/* Optional: Make modal header/footer sticky for better UX */
.modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}
.modal-header h2 {
    margin: 0;
    font-size: 24px;
}
.modal-footer button {
    background-color: #f0873d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}
.modal-footer button:hover {
    background-color: #d16f34;
}
.modal-footer .cancel-button {
    background-color: #ccc;
}
.modal-footer .cancel-button:hover {
    background-color: #bbb;
}
.modal-footer .save-button {
    margin-right: 10px; /* Add margin-right to the save button */
    margin-bottom: 2px;
}
.modal textarea {
    width: 96%;
    height: 63%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
}

#commentDate {
    width: 96%;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    color: #333;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

#commentDate:focus {
    border-color: #f0873d;
    outline: none;
    box-shadow: 0 0 5px rgba(240, 135, 61, 0.5);
}

#addCommentButton:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    border: none;
}

.notification-overlay {
    position: fixed;
    bottom: 80px; /* Increased from 20px to 80px to move above the footer */
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    display: none;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    z-index: 11000; /* Ensure it's above the footer */
}
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.35); /* Darker overlay */
    z-index: 10000;
    display: none;
}
.loading-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    animation: loading-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    opacity: 0.95;
}
@keyframes loading-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.10);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
}

.studentNameInput {
    display: block;
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px auto;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

/* Top Bar */
.topbar {
    background-color: #333;
    color: white;
    padding: 0 20px; /* Remove large padding, use smaller spacing */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px; /* Give a fixed height to the topbar */
    z-index: 100;
    box-sizing: border-box;
}

.menu-btn {
    font-size: 24px;
    cursor: pointer;
    border: none;
    background: none;
    color: white;
    padding: 10px; /* Add a specific padding so the button doesn’t stretch */
    margin-right: auto; /* Align to the left */
    width: auto; /* Ensure it doesn’t take the full width */
}

.menu-btn:hover {
    color: #ccc;
}

.title {
    font-size: 20px;
    text-align: center;
    flex-grow: 1; /* Ensures the title takes the available space between elements */
    margin: 0;
}

.user-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ccc; /* fallback color */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    overflow: hidden; /* Ensures image doesn't exceed the bounds */
}

.user-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fits inside the circle */
    border-radius: 50%; /* Makes sure the image stays circular */
}

/* Sidebar */
.sidebar {
    height: 100%;
    width: 0; /* Ensure it starts closed */
    position: fixed;
    top: 0;
    left: 0;
    background-color: #333; /* Match topbar color */
    overflow-x: hidden;
    transition: 0.3s;
    padding-top: 60px;
    z-index: 99;
}

.sidebar a {
    padding: 10px 15px;
    text-decoration: none;
    font-size: 18px;
    color: white;
    display: block;
    transition: 0.2s;
}

.sidebar a:hover {
    background-color: #575757;
}

.sidebar.open {
    width: 250px;
}

/* Main content */
.main-content {
    margin-top: 70px; /* Adjusted to allow space for the top bar */
    padding: 20px;
}

/* Container Styling */
.container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-top: 20px;
}
.notification-overlay {
    position: fixed;
    bottom: 80px; /* Increased from 20px to 80px to move above the footer */
    right: 20px;
    background-color: #4caf50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    display: none;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    z-index: 11000; /* Ensure it's above the footer */
}
.ai-text-container {
    background-color: #ffffff; /* White background for a clean look */
    border: 2px solid #f0873d; /* Strong border color to stand out */
    border-radius: 10px; /* Rounded corners */
    padding: 15px; /* Padding for spacing inside */
    margin: 20px 0; /* Margin for spacing around the container */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Light shadow for depth */
    position: relative; /* Add this to allow absolute positioning inside */
    min-height: 60px; /* Optional: ensures enough space for the powered-by label */
}

.ai-text-container ul {
    list-style-type: none; /* Remove default bullet points */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
}

.ai-text-container li {
    padding: 8px 0; /* Space around list items */
    font-size: 16px; /* Font size */
}

.ai-text-container li:before {
    content: "•"; /* Simple bullet character */
    color: #f0873d; /* Bullet color to match border */
    font-weight: bold; /* Bold bullet */
    display: inline-block; /* Ensure the bullet is inline with text */
    width: 15px; /* Space between bullet and text */
    font-size: 20px; /* Bullet size */
    vertical-align: middle; /* Align bullet vertically with text */
}
.student-table {
    width: 100%;
    border-collapse: collapse;
}

.student-table th,
.student-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.student-table th {
    background-color: #f2f2f2;
    text-align: left;
}
#statistics {
    /* display: block; Change to block when you want it visible */
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: auto;
    text-align: center;
    font-family: Arial, sans-serif;
}

#statistics h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

#statistics p {
    font-size: 18px;
    color: #555;
    margin: 10px 0;
}

#statistics p span {
    font-weight: bold;
    font-size: 20px;
    color: #007bff;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #fff;
    border-radius: 5px;
    margin: 10px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.stat-item p {
    margin: 0;
    font-size: 16px;
}

.stat-item span {
    font-weight: bold;
    color: #f0873d;
    font-size: 18px;
}
/* Style for the manage students container */
#manageStudents {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Manage Students container styling */
#manageStudents {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Header styles */
#manageStudents h2 {
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
}

#manageStudents p {
    color: #666;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* Search bar styling */
.search-container {
    margin-bottom: 15px;
}

.stat-card {
    background: #fff;
    border: 2px solid #f0873d;
    border-radius: 8px;
    padding: 20px;
    margin: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: inline-block;
    width: 10%;
}

.stat-number {
    font-size: 24px;
    color: #333;
    transition: opacity 1s;
}
#allCommentsListContainer {
    max-height: 500px; /* Set a fixed height to enable scrolling */
    overflow-y: auto; /* Ensure the container allows vertical scrolling */
    border: 1px solid #ccc; /* Optional, for visual clarity */
}
/* Sidebar styles */
.sidebar {
    height: 100%; /* Full height */
    width: 0; /* Initial width */
    position: fixed; /* Stay in place */
    z-index: 1; /* Stay on top */
    top: 0;
    left: 0;
    background-color: #333; /* Match topbar color */
    overflow-x: hidden; /* Disable horizontal scroll */
    transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
    padding-top: 60px; /* Place content below the topbar */
}

/* Topbar styles */
.topbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 50px;
    background-color: #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.topbar .menu-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Main content styles */
.main-content {
    margin-top: 50px; /* Add space for the topbar */
    padding: 20px;
    transition: margin-left 0.5s; /* Smooth transition when sidebar opens */
}

.footer {
    background-color: #333;
    color: white;
    text-align: center;
    /* Remove box-shadow for less abruptness */
    box-shadow: none;
    margin-top: auto;
    position: fixed;
    bottom: 0;
    width: 100%;
    /* Make the footer smaller */
    font-size: 13px;
    padding: 1px;
    opacity: 0.85;
}

.year-heading {
    font-size: 20px;
    font-weight: bold;
    color: #f0873d;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

/* Remove overflow-x from .table-container if not needed elsewhere */
.table-container {
    /* overflow-x: auto;  -- moved to HTML, now handled by CSS */
    width: 100%;
}

/* AI summary powered by text */
.ai-powered-by {
    position: absolute;
    bottom: 8px;
    right: 16px;
    font-size: 11px;
    color: #888;
    opacity: 0.8;
    pointer-events: none;
    background: #fff;
    padding: 2px 6px;
    border-radius: 6px;
}

/* Modal close button */
.close-modal {
    cursor: pointer;
    font-size: 20px;
}

/* Remove inline margin from #commentDate and #addCommentText */
#commentDate {
    margin-bottom: 10px;
}

/* Remove inline width from #addCommentText */
#addCommentText {
    width: calc(100% - 20px);
}

/* Remove inline display from .modal */
.modal {
    /* display: none; already present */
}

/* Remove inline display from .modal-footer */
.modal-footer {
    display: flex;
    justify-content: space-between;
}

/* Remove inline margin from .save-button in modal-footer */
.save-button {
    margin-bottom: 2px;
}

/* Remove inline justify-content from .modal-footer */
.modal-footer {
    justify-content: space-between;
}

/* Remove inline display from .container.interface */
.container.interface {
    /* display: none; handled by JS */
}

/* Remove inline overflow-x from .table-container */
.table-container {
    overflow-x: auto;
}

#maintenanceOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(30,30,30,0.95);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.maintenance-message {
    background: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 90vw;
}
.maintenance-message h2 {
    color: #f0873d;
    margin-bottom: 18px;
}
.maintenance-message a {
    color: #f0873d;
    text-decoration: underline;
    word-break: break-all;
}

/* Notes block styling for comment notes */
.notes-block {
    background: #f6f1e7;
    border: 1.5px solid #f0873d;
    border-radius: 8px;
    margin-top: 12px;
    margin-bottom: 4px;
    padding: 10px 14px 8px 14px;
    box-shadow: 0 2px 8px rgba(240,135,61,0.06);
    font-size: 15px;
}

.notes-title {
    font-weight: bold;
    color: #f0873d;
    margin-bottom: 8px;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.notes-list {
    margin: 0;
    padding: 0;
}

.note-item {
    border-bottom: 1px solid #f3d7b6;
    padding: 7px 0 5px 0;
    margin-bottom: 2px;
    display: flex;
    flex-direction: column;
}

.note-item:last-child {
    border-bottom: none;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #555;
    margin-bottom: 2px;
}

.note-author {
    font-weight: bold;
    color: #d16f34;
}

.note-date {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
}

.note-text {
    font-size: 15px;
    color: #333;
    margin-left: 2px;
    margin-top: 1px;
    word-break: break-word;
}

.student-table tr.student-row {
    cursor: pointer;
    transition: background 0.2s;
}
.student-table tr.student-row:hover {
    background: #ffe5cc;
}

/* --- Modal Improvements for Edit and Add Note --- */
.modal-content form label {
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
    color: #333;
}

.modal-content form input[type="text"],
.modal-content form input[type="date"],
.modal-content form select,
.modal-content form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    margin-bottom: 0;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    background: #fafafa;
}

.modal-content form textarea {
    min-height: 70px;
    max-height: 200px;
    resize: vertical;
}

.modal-content form .modal-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    background: none;
    position: static;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-content .modal-header {
    margin-bottom: 18px;
}

.modal-content .close-modal {
    float: right;
    margin-left: 10px;
}

#editStudentModal .modal-content,
#addNoteModal .modal-content,
#editModal .modal-content {
    max-width: 420px;
    width: 95%;
    min-width: 280px;
    padding: 24px 24px 18px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.13);
}

#editStudentModal .modal-header,
#addNoteModal .modal-header,
#editModal .modal-header {
    border-bottom: 1px solid #eee;
    margin-bottom: 18px;
    padding-bottom: 8px;
}

#editStudentModal .modal-footer,
#addNoteModal .modal-footer,
#editModal .modal-footer {
    border-top: 1px solid #eee;
    margin-top: 18px;
    padding-top: 8px;
    background: none;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#editStudentModal input[type="text"],
#editStudentModal input[type="date"],
#editStudentModal select,
#addNoteModal input[type="date"],
#addNoteModal textarea,
#editModal textarea {
    width: 100%;
    margin-bottom: 0;
    margin-top: 4px;
}

#addNoteModal label,
#editStudentModal label {
    margin-bottom: 10px;
    display: block;
}

#addNoteModal textarea,
#editModal textarea {
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    font-size: 15px;
    padding: 10px;
}

#addNoteModal input[type="date"] {
    font-size: 15px;
    padding: 8px 10px;
}

#addNoteModal .modal-footer button,
#editStudentModal .modal-footer button,
#editModal .modal-footer button {
    min-width: 90px;
    padding: 8px 0;
    font-size: 15px;
}

#addNoteModal .modal-header h2,
#editStudentModal .modal-header h2,
#editModal .modal-header h2 {
    font-size: 21px;
    margin: 0;
}