/* General Styles */
body {
    font-family: 'Arial', sans-serif; /* Using a common sans-serif font */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333; /* Dark grey text for readability */
    background-color: #f4f4f4; /* Light grey background */
}

.container {
    width: 85%; /* Content width */
    max-width: 1200px; /* Maximum width */
    margin: auto; /* Center the container */
    overflow: hidden; /* Clear floats */
    padding: 20px 0; /* Vertical padding */
}

h1, h2, h3 {
    color: #0056b3; /* School primary color - A shade of blue */
    margin-bottom: 0.8em; /* Spacing below headings */
}

p {
    margin-bottom: 1em; /* Spacing below paragraphs */
}

a {
    color: #0056b3; /* Link color matching primary */
    text-decoration: none; /* No underline by default */
}

a:hover {
    text-decoration: underline; /* Underline on hover */
}

/* Placeholder for images - provides visual indication */
img.placeholder {
    max-width: 100%; /* Ensure images are responsive */
    height: auto; /* Maintain aspect ratio */
    background-color: #ccc; /* Grey background for placeholder */
    border: 1px solid #aaa; /* Subtle border */
    display: block; /* Ensure block-level behavior */
    margin: 15px 0; /* Spacing around images */
    min-height: 150px; /* Minimum height to ensure visibility */
    text-align: center;
    line-height: 150px; /* Center placeholder text vertically */
    color: #666;
    font-style: italic;
}

/* Header & Navigation */
header {
    background: #004080; /* Darker blue for header */
    color: #ffffff; /* White text */
    padding-top: 15px;
    padding-bottom: 10px;
    border-bottom: #0056b3 3px solid; /* Accent border */
}

header .container {
    display: flex; /* Use flexbox for layout */
    justify-content: space-between; /* Space out branding and nav */
    align-items: center; /* Vertically align items */
}

header #branding h1 {
    margin: 0; /* Remove default margin */
    font-size: 1.8em; /* Larger font size for school name */
    color: #ffffff; /* Ensure title is white */
}
header #branding h1 a {
    color: #ffffff; /* Ensure link is white */
    text-decoration: none; /* No underline */
}


header nav ul {
    padding: 0;
    margin: 0;
    list-style: none; /* Remove bullet points */
    display: flex; /* Align nav items horizontally */
    align-items: center; /* Vertically align nav items */
}

header nav ul li {
    margin-left: 20px; /* Spacing between nav items */
}

header nav ul li a {
    color: #ffffff; /* White link text */
    font-weight: bold;
    font-size: 1.1em;
    padding: 5px 0; /* Add some padding for easier clicking */
    transition: color 0.3s ease; /* Smooth color transition on hover */
}

header nav ul li a:hover,
header nav ul li a.current { /* Style for hover and current page */
    color: #aaccff; /* Lighter blue for hover/current */
    text-decoration: none; /* No underline */
}

/* Login Button Styling */
.login-button {
    background-color: #ffc107; /* Standout color - yellow/gold */
    color: #333; /* Dark text for contrast */
    padding: 8px 15px; /* Padding inside the button */
    border: none; /* No border */
    border-radius: 5px; /* Rounded corners */
    font-weight: bold;
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transitions */
    font-size: 1em; /* Match nav item font size */
    margin-left: 20px; /* Spacing from other nav items */
}

.login-button:hover {
    background-color: #e0a800; /* Darker gold on hover */
    color: #000; /* Black text on hover */
    text-decoration: none; /* Remove underline on hover */
}

/* Main Content Area */
main {
    padding: 20px 0; /* Vertical padding */
    background-color: #ffffff; /* White background for content */
    min-height: 400px; /* Minimum height */
}

/* General Content Section Styling */
.content-section {
    background: #ffffff; /* White background */
    padding: 25px; /* Padding within sections */
    margin-bottom: 20px; /* Space between sections */
    border-radius: 5px; /* Slightly rounded corners */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.content-section h2 {
    margin-top: 0; /* Remove default top margin */
    border-bottom: 2px solid #0056b3; /* Accent line below H2 */
    padding-bottom: 10px; /* Space below H2 text */
    margin-bottom: 20px; /* Space below the accent line */
}

/* Specific Page Elements */

/* Homepage Hero Section */
#hero {
    min-height: 400px; /* Good height for impact */
    /* Placeholder background - REPLACE with actual image URL */
    background: url('https://placehold.co/1200x400/557799/FFFFFF?text=Summit+International+High+School+Campus') no-repeat center center/cover;
    background-color: #557799; /* Fallback color */
    color: #ffffff; /* White text */
    text-align: center;
    display: flex; /* Use flexbox for centering content */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Padding inside hero */
}
#hero h1 {
    font-size: 3em; /* Large heading */
    margin-bottom: 10px;
    color: #ffffff; /* Ensure white color */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6); /* Text shadow for readability */
}
#hero p {
    font-size: 1.3em; /* Subtitle size */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6); /* Text shadow */
}

/* News Section Styling */
.news-item {
    border-bottom: 1px dotted #ccc; /* Separator line */
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.news-item:last-child {
    border-bottom: none; /* Remove border from last item */
}
.news-item h3 {
    margin-bottom: 5px; /* Space below news title */
}
.news-item h3 a {
    color: #004080; /* Darker blue for news titles */
}
.news-item .date {
    font-size: 0.9em;
    color: #666; /* Grey for date */
    margin-bottom: 10px;
}

/* Academics - Course List Styling */
.course-list ul {
    list-style: none; /* Remove default bullets */
    padding: 0;
}
.course-list li {
    background: #e9ecef; /* Light grey background for course items */
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 5px solid #0056b3; /* Accent border on the left */
}
.course-list h3 { /* Department headings */
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}
.course-list h4 { /* Course titles */
    margin: 0 0 5px 0;
    color: #004080; /* Darker blue for course titles */
}

/* Admissions Section Styling */
.admissions-steps ol {
    list-style: decimal; /* Numbered list */
    margin-left: 20px; /* Indentation */
}
.admissions-steps li {
    margin-bottom: 15px; /* Spacing between steps */
    line-height: 1.8; /* Increase line height for readability */
}
.apply-button {
    display: inline-block; /* Allow padding and margin */
    background: #28a745; /* Green for call to action */
    color: #ffffff;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.apply-button:hover {
    background: #218838; /* Darker green on hover */
    text-decoration: none;
    color: #ffffff;
}

/* Contact Form Styling */
.contact-form label {
    display: block; /* Labels on their own line */
    margin: 10px 0 5px;
    font-weight: bold;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; /* Full width */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width calculation */
    font-size: 1em;
}
.contact-form textarea {
    height: 150px; /* Taller text area */
    resize: vertical; /* Allow vertical resizing */
}
.contact-form button {
    display: inline-block;
    background: #0056b3; /* Primary blue */
    color: #ffffff;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}
.contact-form button:hover {
    background: #004080; /* Darker blue on hover */
}

/* Footer Styling */
footer {
    background: #333333; /* Dark grey footer */
    color: #ffffff; /* White text */
    text-align: center;
    padding: 25px 0; /* Padding */
    margin-top: 30px; /* Space above footer */
}
footer p {
    margin: 0; /* Remove default paragraph margin */
}

/* Responsive Design Adjustments */
@media(max-width: 768px) {
    header .container {
        flex-direction: column; /* Stack header items vertically */
        text-align: center;
    }

    header #branding {
        margin-bottom: 10px; /* Space below branding */
    }

    header nav ul {
        margin-top: 15px;
        flex-direction: column; /* Stack nav items vertically */
        width: 100%; /* Full width */
    }

    header nav ul li {
        margin: 10px 0; /* Adjust spacing for vertical layout */
        margin-left: 0; /* Remove left margin */
        width: 100%; /* Make nav items take full width */
        text-align: center;
    }

    .login-button {
        margin-left: 0; /* Remove left margin */
        margin-top: 10px; /* Add top margin */
        width: auto; /* Adjust width or make it inline-block */
        padding: 10px 20px; /* Adjust padding if needed */
    }

    #hero h1 {
        font-size: 2.5em; /* Slightly smaller heading on mobile */
    }
    #hero p {
        font-size: 1.1em; /* Slightly smaller subtitle */
    }

    .container {
        width: 95%; /* Use more screen width on smaller devices */
    }

    /* Adjust flex layout for contact page on smaller screens */
    .contact-info-form-wrapper {
        flex-direction: column;
    }
}

/* ========== Portal Page Styles ========== */

/* Portal Header Adjustments */
.portal-header {
    background: #004080; /* Match existing header */
    color: #ffffff;
    padding: 15px 0;
    border-bottom: #0056b3 3px solid;
}

.portal-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-header h1 {
    margin: 0;
    font-size: 1.8em;
    color: #ffffff;
}
.portal-header h1 a {
    color: #ffffff;
    text-decoration: none;
}


.portal-header .user-info {
    font-size: 0.9em;
    text-align: right;
}

.portal-header .user-info span {
    margin-right: 15px; /* Space between name and logout */
}

.portal-header .logout-button {
    background-color: #dc3545; /* Red for logout */
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
    text-decoration: none; /* Ensure link looks like a button */
    display: inline-block; /* Proper button behavior */
}

.portal-header .logout-button:hover {
    background-color: #c82333; /* Darker red on hover */
    color: white;
    text-decoration: none;
}


/* Portal Main Content */
.portal-main {
    padding: 30px 0; /* More padding for portal */
    background-color: #f8f9fa; /* Slightly different background for portal area */
}

.portal-welcome {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.portal-welcome h2 {
    margin-top: 0;
    color: #0056b3;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    /* Create responsive columns: 1 col on small, 2 on medium, 3 on large screens */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; /* Space between cards */
}

/* Dashboard Card Styling */
.dashboard-card {
    background-color: #ffffff;
    border-radius: 8px; /* More rounded corners for cards */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Slightly more pronounced shadow */
    padding: 20px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex; /* Use flexbox for icon alignment */
    flex-direction: column; /* Stack content vertically */
    min-height: 150px; /* Ensure cards have some height */
}

.dashboard-card:hover {
    transform: translateY(-5px); /* Lift card slightly on hover */
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #004080; /* Darker blue for card titles */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 1.3em;
    display: flex;
    align-items: center; /* Align icon and text */
}

/* Simple placeholder for icons (using text symbols) */
.dashboard-card h3::before {
    content: '►'; /* Default icon */
    margin-right: 10px;
    font-size: 1em;
    color: #0056b3;
    display: inline-block; /* Needed for margin */
}

/* Specific icons for cards (examples) */
.card-announcements h3::before { content: '📢'; }
.card-grades h3::before { content: '📊'; }
.card-schedule h3::before { content: '📅'; }
.card-profile h3::before { content: '👤'; }
.card-applications h3::before { content: '📝'; }
.card-resources h3::before { content: '📚'; }
.card-directory h3::before { content: '👥'; }
.card-events h3::before { content: '🎉'; }


.dashboard-card p {
    font-size: 0.95em;
    color: #555;
    flex-grow: 1; /* Allow paragraph to take available space */
    margin-bottom: 15px;
}

.dashboard-card a.card-link {
    background-color: #0056b3;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Push link to the bottom */
    display: block; /* Make link take full width */
}

.dashboard-card a.card-link:hover {
    background-color: #004080;
    color: white;
    text-decoration: none;
}

/* Responsive Adjustments for Portal */
@media(max-width: 768px) {
    .portal-header .container {
        flex-direction: column;
        text-align: center;
    }
    .portal-header .user-info {
        margin-top: 10px;
        text-align: center;
    }
    .portal-header .logout-button {
        margin-left: 0; /* Remove left margin if needed */
    }
    .dashboard-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }
}

/* ========== Applications Page Styles ========== */

.applications-main {
    padding: 30px 0;
    background-color: #f8f9fa; /* Match portal background */
}

.applications-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.applications-section h2 {
    margin-top: 0;
    color: #004080; /* Darker blue */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.applications-section h3 {
    color: #0056b3; /* Primary blue */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Application List Styling */
.application-list ul {
    list-style: none;
    padding: 0;
}

.application-item {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fdfdfd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 10px;
}

.application-item .details {
    flex-grow: 1; /* Allow details to take up space */
}

.application-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #333;
}

.application-item p {
    margin: 0;
    font-size: 0.95em;
    color: #555;
}

.application-item .status {
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 100px; /* Ensure status badges have width */
    text-align: center;
}

/* Status Indicator Colors (Examples) */
.status-submitted { background-color: #cfe2ff; color: #0a58ca; } /* Blue */
.status-review { background-color: #fff3cd; color: #664d03; } /* Yellow */
.status-accepted { background-color: #d1e7dd; color: #0f5132; } /* Green */
.status-incomplete { background-color: #f8d7da; color: #842029; } /* Red */
.status-waitlisted { background-color: #e2e3e5; color: #41464b; } /* Grey */


.application-item .actions a {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    background-color: #6c757d; /* Grey */
    color: white;
    transition: background-color 0.2s ease;
}
.application-item .actions a:hover {
    background-color: #5a6268;
}


/* Button for Starting New Application */
.start-application-button {
    display: inline-block;
    background: #198754; /* Different green */
    color: #ffffff;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.start-application-button:hover {
    background: #157347; /* Darker green */
    color: #ffffff;
    text-decoration: none;
}

/* Document List Styling */
.document-list ul {
    list-style: none;
    padding: 0;
}
.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dotted #ccc;
}
.document-item:last-child {
    border-bottom: none;
}
.document-item span {
    color: #333;
}
.document-item .doc-status {
    font-size: 0.9em;
    font-style: italic;
    color: #666;
}
.document-item .doc-status.received {
    color: green;
    font-weight: bold;
}
.document-item .doc-status.missing {
    color: red;
    font-weight: bold;
}
.document-item .upload-link {
    font-size: 0.9em;
    color: #0056b3;
    text-decoration: underline;
    cursor: pointer; /* Indicate it's clickable */
}
.document-item .upload-link:hover {
    color: #004080;
}

/* ========== Announcements Page Styles ========== */

.announcements-main {
    padding: 30px 0;
    background-color: #f8f9fa; /* Match portal background */
}

.announcements-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.announcements-section h2 {
    margin-top: 0;
    color: #004080; /* Darker blue */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

/* Filter/Sort Controls (Visual Placeholder) */
.announcement-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e9ecef; /* Light grey background for controls */
    border-radius: 5px;
}

.announcement-controls label {
    font-weight: bold;
    margin-right: 5px;
    color: #333;
}

.announcement-controls select,
.announcement-controls input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Announcement List Styling */
.announcement-list ul {
    list-style: none;
    padding: 0;
}

.announcement-item {
    border: 1px solid #e0e0e0;
    border-left: 5px solid #0056b3; /* Accent border color */
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.announcement-item:hover {
     box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* Different border colors for categories (Examples) */
.announcement-item.category-academics { border-left-color: #ffc107; } /* Yellow */
.announcement-item.category-events { border-left-color: #198754; } /* Green */
.announcement-item.category-general { border-left-color: #0d6efd; } /* Blue */
.announcement-item.category-urgent { border-left-color: #dc3545; } /* Red */


.announcement-item .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Wrap on small screens */
    gap: 5px;
}

.announcement-item h3 {
    margin: 0;
    font-size: 1.3em;
    color: #004080;
    flex-grow: 1; /* Allow title to take space */
}

.announcement-item .meta {
    font-size: 0.9em;
    color: #666;
    text-align: right;
    flex-shrink: 0; /* Prevent shrinking */
}

.announcement-item .meta span {
    display: block; /* Stack date and author */
}

.announcement-item .content {
    margin-bottom: 15px;
    line-height: 1.7;
    color: #333;
}

.announcement-item .tags span {
    display: inline-block;
    background-color: #e2e3e5;
    color: #41464b;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    margin-right: 5px;
    margin-top: 5px;
}

/* Specific tag colors (Examples) */
.announcement-item .tags .tag-urgent { background-color: #f8d7da; color: #842029; }
.announcement-item .tags .tag-events { background-color: #d1e7dd; color: #0f5132; }
.announcement-item .tags .tag-academics { background-color: #fff3cd; color: #664d03; }

.announcement-item .read-more {
    display: inline-block;
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
    margin-top: 10px;
}

.announcement-item .read-more:hover {
    text-decoration: underline;
    color: #004080;
}

/* Responsive adjustments for controls */
@media(max-width: 600px) {
    .announcement-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .announcement-item .header {
        flex-direction: column;
        align-items: flex-start;
    }
     .announcement-item .meta {
        text-align: left;
        margin-top: 5px;
    }
}

/* ========== Grades Page Styles ========== */

.grades-main {
    padding: 30px 0;
    background-color: #f8f9fa; /* Match portal background */
}

.grades-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.grades-section h2 {
    margin-top: 0;
    color: #004080; /* Darker blue */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.grades-section h3 {
    color: #0056b3; /* Primary blue */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Academic Summary Styling */
.academic-summary {
    display: flex;
    justify-content: space-around; /* Space out summary items */
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background-color: #e9ecef;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 30px;
}

.summary-item {
    flex: 1; /* Allow items to grow */
    min-width: 150px; /* Minimum width for each item */
}

.summary-item .label {
    font-size: 0.95em;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 1.8em;
    font-weight: bold;
    color: #004080;
}

/* Course Grades Table Styling */
.grades-table {
    width: 100%;
    border-collapse: collapse; /* Remove space between borders */
    margin-top: 15px;
    font-size: 1em;
}

.grades-table th,
.grades-table td {
    border: 1px solid #ddd; /* Light grey border */
    padding: 12px 15px; /* Padding inside cells */
    text-align: left;
    vertical-align: middle; /* Align content vertically */
}

.grades-table thead th {
    background-color: #0056b3; /* Primary blue background for header */
    color: white;
    font-weight: bold;
}

.grades-table tbody tr:nth-child(even) {
    background-color: #f9f9f9; /* Zebra striping for rows */
}

.grades-table tbody tr:hover {
    background-color: #f1f1f1; /* Highlight row on hover */
}

.grades-table .course-name {
    font-weight: bold;
    color: #333;
}

.grades-table .grade-value {
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
}

/* Optional: Grade coloring (use sparingly for clarity) */
.grades-table .grade-a { color: #198754; } /* Green for A */
.grades-table .grade-b { color: #0a58ca; } /* Blue for B */
.grades-table .grade-c { color: #ffc107; } /* Yellow for C */
.grades-table .grade-d, .grades-table .grade-f { color: #dc3545; } /* Red for D/F */
.grades-table .grade-ip { color: #6c757d; } /* Grey for In Progress */

.grades-table .details-link a {
    display: inline-block;
    padding: 5px 10px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.grades-table .details-link a:hover {
    background-color: #5a6268;
}

/* Recent Assignments Table */
/* Can reuse .grades-table styles or create specific ones if needed */
.assignments-table .assignment-name {
    font-style: italic;
}
.assignments-table .score {
    text-align: center;
}
.assignments-table .due-date {
    font-size: 0.9em;
    color: #555;
}

/* Responsive Table Handling (Simple scroll) */
.table-responsive-wrapper {
    overflow-x: auto; /* Add horizontal scroll if table overflows */
    margin-top: 15px;
}

/* ========== Login Page Styles ========== */

.login-main {
    padding: 50px 0; /* More vertical padding */
    background-color: #f8f9fa; /* Light background */
    min-height: calc(100vh - 150px); /* Adjust based on header/footer height */
    display: flex;
    align-items: center; /* Vertically center */
    justify-content: center; /* Horizontally center */
}

.login-container {
    background-color: #ffffff;
    padding: 30px 40px; /* More padding */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px; /* Limit login box width */
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #004080;
    font-size: 1.8em;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left; /* Align labels left */
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px; /* Larger input fields */
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1em;
}

.login-form .login-submit-button {
    background-color: #0056b3;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    width: 100%; /* Full width button */
    margin-top: 10px;
}

.login-form .login-submit-button:hover {
    background-color: #004080;
}

.login-links {
    margin-top: 20px;
    font-size: 0.9em;
}

.login-links a {
    color: #0056b3;
    text-decoration: none;
    margin: 0 10px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* Error Message Styling */
#login-error-message {
    color: #dc3545; /* Red */
    background-color: #f8d7da; /* Light red background */
    border: 1px solid #f5c2c7;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 20px;
    display: none; /* Hidden by default */
    text-align: center;
    font-size: 0.95em;
}

/* ========== Teacher Interface Styles ========== */

/* General Teacher Portal Styles (can reuse some portal styles) */
.teacher-main {
    padding: 30px 0;
    background-color: #f8f9fa; /* Match portal background */
}

.teacher-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.teacher-section h2 {
    margin-top: 0;
    color: #004080; /* Darker blue */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.teacher-section h3 {
    color: #0056b3; /* Primary blue */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Teacher Dashboard Specific */
/* Can reuse .dashboard-grid and .dashboard-card from student portal if desired, */
/* or create specific teacher versions if layout needs differ significantly. */
/* For simplicity, we'll reuse for now. Add teacher-specific card icons. */
.card-attendance h3::before { content: '✔️'; } /* Check mark */
.card-gradebook h3::before { content: '📖'; } /* Open book */
.card-classes h3::before { content: '🏫'; } /* School building */
.card-communication h3::before { content: '✉️'; } /* Envelope */


/* Attendance Page Styles */
.attendance-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.attendance-controls label {
    font-weight: bold;
    margin-right: 5px;
}

.attendance-controls select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.attendance-table th,
.attendance-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.attendance-table thead th {
    background-color: #0056b3;
    color: white;
}

.attendance-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.attendance-table .student-name {
    font-weight: bold;
}

.attendance-table .status-buttons button {
    padding: 5px 10px;
    margin: 0 3px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    min-width: 60px; /* Ensure buttons have some width */
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Default button state */
.attendance-table .status-buttons button {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #333;
}
.attendance-table .status-buttons button:hover {
    background-color: #e2e6ea;
    border-color: #ced4da;
}

/* Active button states */
.attendance-table .status-buttons button.active-present {
    background-color: #d1e7dd; /* Light green */
    border-color: #a3cfbb;
    color: #0f5132; /* Dark green */
    font-weight: bold;
}
.attendance-table .status-buttons button.active-absent {
    background-color: #f8d7da; /* Light red */
    border-color: #f1aeb5;
    color: #842029; /* Dark red */
    font-weight: bold;
}
.attendance-table .status-buttons button.active-tardy {
    background-color: #fff3cd; /* Light yellow */
    border-color: #ffe69c;
    color: #664d03; /* Dark yellow */
    font-weight: bold;
}

.attendance-summary {
    margin-top: 20px;
    font-size: 0.95em;
    text-align: right;
}

.attendance-submit-button {
     display: block; /* Make it block level */
     width: fit-content; /* Size to content */
     margin: 25px auto 0 auto; /* Center the button */
     background-color: #198754;
     color: white;
     padding: 10px 25px;
     border: none;
     border-radius: 5px;
     font-size: 1.1em;
     cursor: pointer;
     transition: background-color 0.3s ease;
}
.attendance-submit-button:hover {
    background-color: #157347;
}


/* Gradebook Page Styles */
.gradebook-controls { /* Similar to attendance controls */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 5px;
}
.gradebook-controls label { font-weight: bold; margin-right: 5px; }
.gradebook-controls select { padding: 8px 10px; border: 1px solid #ccc; border-radius: 4px; }
.gradebook-controls button { padding: 8px 15px; border: none; background-color: #0056b3; color: white; border-radius: 4px; cursor: pointer; }
.gradebook-controls button:hover { background-color: #004080; }


.gradebook-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.gradebook-table th,
.gradebook-table td {
    border: 1px solid #ddd;
    padding: 8px 10px; /* Slightly less padding than attendance */
    text-align: center;
    vertical-align: middle;
}
.gradebook-table th.student-name-header,
.gradebook-table td.student-name-cell {
    text-align: left;
    font-weight: bold;
    background-color: #f8f9fa; /* Light background for names */
    position: sticky; /* Make student names sticky */
    left: 0;
    z-index: 1;
}


.gradebook-table thead th {
    background-color: #0056b3;
    color: white;
    font-size: 0.9em;
    position: sticky; /* Make headers sticky */
    top: 0;
    z-index: 2;
}
.gradebook-table thead th span.assignment-date {
    display: block;
    font-size: 0.8em;
    font-weight: normal;
    color: #e0e0e0;
}


.gradebook-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}
.gradebook-table tbody tr:hover {
    background-color: #f1f1f1;
}

.gradebook-table input[type="number"],
.gradebook-table input[type="text"].grade-input { /* Allow text for excused etc. */
    width: 60px; /* Fixed width for grade inputs */
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    font-size: 0.95em;
    box-sizing: border-box;
     /* Remove arrows for number input */
    -moz-appearance: textfield;
}
.gradebook-table input::-webkit-outer-spin-button,
.gradebook-table input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.gradebook-table .calculated-grade {
    font-weight: bold;
    background-color: #e9ecef; /* Highlight calculated grade */
    min-width: 60px;
}

/* Responsive wrapper for gradebook */
.gradebook-responsive-wrapper {
    overflow-x: auto; /* Allow horizontal scroll */
    margin-top: 15px;
    max-height: 600px; /* Optional: Limit height */
    overflow-y: auto; /* Allow vertical scroll if needed */
}

.gradebook-save-button {
     display: block; /* Make it block level */
     width: fit-content; /* Size to content */
     margin: 25px auto 0 auto; /* Center the button */
     background-color: #198754;
     color: white;
     padding: 10px 25px;
     border: none;
     border-radius: 5px;
     font-size: 1.1em;
     cursor: pointer;
     transition: background-color 0.3s ease;
}
.gradebook-save-button:hover {
    background-color: #157347;
}

/* ========== Admin Interface Styles ========== */

/* General Admin Portal Styles (can reuse some portal/teacher styles) */
.admin-main {
    padding: 30px 0;
    background-color: #e9ecef; /* Slightly different admin background */
}

.admin-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.admin-section h2 {
    margin-top: 0;
    color: #004080; /* Darker blue */
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

.admin-section h3 {
    color: #0056b3; /* Primary blue */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Admin Dashboard Specific */
/* Reusing .dashboard-grid and .dashboard-card */
/* Add admin-specific card icons. */
.card-users h3::before { content: '🧑‍🤝‍🧑'; font-size: 1.1em; margin-right: 8px; } /* People */
.card-settings h3::before { content: '⚙️'; font-size: 1.1em; margin-right: 8px; } /* Gear */
.card-content h3::before { content: '📰'; font-size: 1.1em; margin-right: 8px; } /* Newspaper */
.card-reports h3::before { content: '📈'; font-size: 1.1em; margin-right: 8px; } /* Graph */
.card-security h3::before { content: '🔒'; font-size: 1.1em; margin-right: 8px; } /* Lock */
.card-logs h3::before { content: '📜'; font-size: 1.1em; margin-right: 8px; } /* Scroll */


/* Admin User Management Table (Example) */
.admin-table { /* Generic table style for admin pages */
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
    font-size: 0.95em; /* Slightly smaller font for tables */
}
.admin-table thead th {
    background-color: #004080; /* Darker blue for admin headers */
    color: white;
    font-weight: bold;
}
.admin-table tbody tr:nth-child(even) { background-color: #f9f9f9; }
.admin-table tbody tr:hover { background-color: #f1f1f1; }
.admin-table .actions a,
.admin-table .actions button {
    display: inline-block;
    margin: 2px 4px; /* Adjust margin for spacing */
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    vertical-align: middle; /* Align buttons nicely */
}
.admin-table .actions .edit-btn { background-color: #ffc107; color: #333; }
.admin-table .actions .edit-btn:hover { background-color: #e0a800; }
.admin-table .actions .delete-btn { background-color: #dc3545; }
.admin-table .actions .delete-btn:hover { background-color: #c82333; }
.admin-table .actions .reset-btn { background-color: #6c757d; }
.admin-table .actions .reset-btn:hover { background-color: #5a6268; }
.admin-table .actions button:disabled {
    background-color: #adb5bd; /* Grey out disabled buttons */
    cursor: not-allowed;
}


/* Admin Settings Form (Example) */
.admin-settings-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dotted #eee;
}
.admin-settings-form .form-row:last-of-type {
    border-bottom: none; /* Remove border from last row */
}
.admin-settings-form .form-group {
    flex: 1; /* Allow groups to grow */
    min-width: 250px; /* Minimum width */
}
.admin-settings-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 0.95em;
}
.admin-settings-form input[type="text"],
.admin-settings-form input[type="date"],
.admin-settings-form input[type="email"],
.admin-settings-form input[type="number"],
.admin-settings-form select,
.admin-settings-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
}
.admin-settings-form textarea {
    min-height: 80px;
    resize: vertical;
}
.admin-save-button { /* Generic save button */
     display: block;
     width: fit-content;
     margin: 25px auto 0 auto;
     background-color: #198754;
     color: white;
     padding: 10px 25px;
     border: none;
     border-radius: 5px;
     font-size: 1.1em;
     cursor: pointer;
     transition: background-color 0.3s ease;
}
.admin-save-button:hover { background-color: #157347; }


/* Campus Camera Viewer Styles */
.camera-controls {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    display: flex; /* Use flex for better alignment */
    align-items: center;
    gap: 15px; /* Space between label and select */
}
.camera-controls label {
    font-weight: bold;
    margin-right: 0; /* Remove default margin */
}
.camera-controls select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    min-width: 200px;
    flex-grow: 1; /* Allow select to take available space */
    max-width: 400px; /* Optional max width */
}

.camera-view-container {
    border: 1px solid #ccc;
    background-color: #333; /* Dark background for viewer area */
    min-height: 400px; /* Minimum height */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    overflow: hidden; /* Hide overflow if image is too big */
    position: relative; /* For positioning text */
}

.camera-view-container img.camera-feed {
    display: block;
    max-width: 100%;
    max-height: 600px; /* Max height for the image */
    height: auto;
    background-color: #555; /* Placeholder background */
}

.camera-view-container .placeholder-text {
    color: #ccc;
    font-size: 1.5em;
    text-align: center;
    padding: 20px;
}

.camera-disclaimer {
    margin-top: 15px;
    font-size: 0.9em;
    color: #dc3545; /* Red text for warning */
    font-style: italic;
    text-align: center;
    background-color: #f8d7da;
    padding: 10px;
    border: 1px solid #f5c2c7;
    border-radius: 4px;
}

/* Responsive Table Handling */
.table-responsive-wrapper {
    overflow-x: auto; /* Add horizontal scroll if table overflows */
    margin-top: 15px;
}

/* ========== Schedule Page Styles ========== */

.schedule-main {
    padding: 30px 0;
    background-color: #f8f9fa; /* Match portal background */
}

.schedule-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-bottom: 25px;
}

.schedule-section h2 {
    margin-top: 0;
    color: #004080;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.6em;
}

/* Current Time Display */
.current-time-status {
    text-align: right;
    margin-bottom: 20px;
    font-size: 0.95em;
    color: #555;
}
.current-time-status #currentTimeDisplay {
    font-weight: bold;
    color: #004080;
}
.current-time-status #currentPeriodStatus {
    font-style: italic;
    color: #198754; /* Green if in period */
}


/* Term Selector Styles */
.term-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 5px;
}

.term-selector label {
    font-weight: bold;
    color: #333;
    font-size: 1.05em;
}

/* Fancy Dropdown Styling */
.term-selector select#term-select {
    appearance: none; /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    padding: 10px 30px 10px 15px; /* Space for custom arrow */
    font-size: 1em;
    border-radius: 5px;
    cursor: pointer;
    min-width: 200px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
    transition: border-color 0.2s ease;
}
.term-selector select#term-select:hover {
    border-color: #86b7fe;
}
.term-selector select#term-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}


/* Schedule Table Styles */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 1em;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.schedule-table thead th {
    background-color: #0056b3;
    color: white;
    font-weight: bold;
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 1; /* Ensure header is above body */
}

.schedule-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.schedule-table tbody tr:hover {
    background-color: #f1f1f1;
}

.schedule-table .period-number {
    font-weight: bold;
    text-align: center;
    width: 60px; /* Fixed width for period */
}

.schedule-table .course-name {
    font-weight: bold;
    color: #333;
}
.schedule-table .teacher-name {
    font-size: 0.95em;
    color: #555;
}
.schedule-table .room-number {
    font-size: 0.95em;
    color: #555;
    text-align: center;
}
.schedule-table .time-slot {
     font-size: 0.9em;
     color: #666;
     white-space: nowrap; /* Prevent time from wrapping */
}

/* Current Period Highlighting */
.schedule-table tbody tr.current-period {
    background-color: #d1e7dd !important; /* Light green highlight, !important to override hover */
    border-left: 5px solid #198754; /* Darker green left border */
}

.schedule-table tbody tr.current-period td {
    font-weight: bold; /* Make text bold in current period */
}

.current-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.8em;
    color: #0f5132; /* Dark green */
    background-color: #a3cfbb;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: normal; /* Keep indicator normal weight */
    vertical-align: middle;
}

/* Responsive Table */
.schedule-table-wrapper {
     overflow-x: auto; /* Add horizontal scroll if table overflows */
     margin-top: 15px;
}


/* ========== Chat Page Styles ========== */

.chat-main-container {
    display: flex;
    height: calc(100vh - 120px); /* Adjust based on header/footer height */
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden; /* Prevent content spill */
    margin: 20px auto; /* Add some margin */
    max-width: 1400px; /* Limit overall width */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Sidebar (User List/Conversations) */
.chat-sidebar {
    width: 300px;
    border-right: 1px solid #dee2e6;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.chat-sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.chat-sidebar-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    color: #004080;
}

.chat-sidebar-header input[type="email"],
.chat-sidebar-header input[type="text"] { /* Changed to text for easier searching */
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

.conversation-list {
    flex-grow: 1;
    overflow-y: auto; /* Allow scrolling */
}

.conversation-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conversation-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.conversation-list li:hover {
    background-color: #e9ecef;
}
.conversation-list li.active-chat {
    background-color: #cfe2ff; /* Light blue for active chat */
    font-weight: bold;
}

.conversation-list .user-avatar { /* Simple circle avatar */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #0056b3; /* Placeholder color */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.conversation-list .user-info .name {
    font-weight: bold;
    color: #333;
    font-size: 1em;
    margin-bottom: 2px; /* Small space */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-list .user-info .last-message {
    font-size: 0.85em;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Chat Window */
.chat-window {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.chat-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #004080;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto; /* Enable scrolling for messages */
    display: flex;
    flex-direction: column-reverse; /* Newest messages at the bottom */
    background-color: #f0f2f5; /* Slightly different background for messages */
}

/* Message Bubble Styles */
.message-container {
    display: flex;
    margin-bottom: 15px;
    max-width: 75%; /* Limit message width */
}

.message-bubble {
    padding: 10px 15px;
    border-radius: 18px; /* Bubble shape */
    position: relative;
    word-wrap: break-word; /* Break long words */
}
.message-bubble .timestamp {
    font-size: 0.75em;
    color: #6c757d; /* Grey timestamp */
    margin-top: 5px;
    display: block;
    text-align: right;
}

/* Sent Messages */
.message-container.sent {
    margin-left: auto; /* Push to the right */
    flex-direction: row-reverse; /* Keep delete button near bubble */
}
.message-container.sent .message-bubble {
    background-color: #007bff; /* Blue for sent */
    color: white;
    border-bottom-right-radius: 5px; /* Flat corner */
}
.message-container.sent .timestamp {
    color: #e0e0e0; /* Lighter timestamp */
}

/* Received Messages */
.message-container.received {
    margin-right: auto; /* Push to the left */
}
.message-container.received .message-bubble {
    background-color: #e9ecef; /* Light grey for received */
    color: #333;
    border-bottom-left-radius: 5px; /* Flat corner */
}

/* Delete Button */
.delete-message-btn {
    background: none;
    border: none;
    color: #adb5bd; /* Light grey icon */
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease, color 0.2s ease;
    align-self: center; /* Vertically align */
    margin: 0 5px;
}
.message-container:hover .delete-message-btn {
    opacity: 1; /* Show on hover */
}
.message-container.sent:hover .delete-message-btn {
     color: #ffc107; /* Yellowish on hover for sent */
}
.delete-message-btn:hover {
    color: #dc3545 !important; /* Red on button hover */
}


/* Message Input Area */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Prevent input area from shrinking */
}

.chat-input-area input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 20px; /* Rounded input */
    font-size: 1em;
    outline: none;
}
.chat-input-area input[type="text"]:focus {
     border-color: #86b7fe;
     box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}


.chat-input-area button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%; /* Circular button */
    width: 45px;
    height: 45px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}
.chat-input-area button:hover {
    background-color: #0056b3;
}
.chat-input-area button:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}


/* Placeholder for when no chat is selected */
.no-chat-selected {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
    font-size: 1.2em;
    text-align: center;
    padding: 20px;
}
.no-chat-selected svg { /* Simple message icon */
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    fill: #adb5bd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-main-container {
        flex-direction: column;
        height: calc(100vh - 60px); /* Adjust for smaller header */
    }
    .chat-sidebar {
        width: 100%;
        height: 250px; /* Fixed height for sidebar on mobile */
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    .message-container {
        max-width: 90%; /* Allow messages to be wider on mobile */
    }
}


/* ========== Custom Modals & Notifications ========== */

/* General Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it's on top */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

/* Modal Box */
.modal-box {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 450px; /* Limit width */
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-box {
     transform: scale(1);
}


.modal-box h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #004080;
    font-size: 1.3em;
}

.modal-box p {
    margin-bottom: 20px;
    color: #333;
    font-size: 1em;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 100px;
}

.modal-confirm-btn {
    background-color: #dc3545; /* Red for confirm delete */
    color: white;
}
.modal-confirm-btn:hover {
    background-color: #c82333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.modal-cancel-btn {
    background-color: #6c757d; /* Grey for cancel */
    color: white;
}
.modal-cancel-btn:hover {
     background-color: #5a6268;
     box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.modal-ok-btn { /* For simple info alerts */
    background-color: #0d6efd; /* Blue */
    color: white;
}
.modal-ok-btn:hover {
     background-color: #0b5ed7;
     box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}


/* Simple Notification Bar */
.notification-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(50, 50, 50, 0.9);
    color: white;
    padding: 12px 25px;
    border-radius: 25px; /* Pill shape */
    z-index: 1001; /* Above modal overlay potentially */
    font-size: 0.95em;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, bottom 0.4s ease, visibility 0s linear 0.4s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.notification-bar.visible {
    opacity: 1;
    visibility: visible;
    bottom: 30px; /* Slide up */
    transition: opacity 0.4s ease, bottom 0.4s ease;
}
.notification-bar.success { background-color: rgba(25, 135, 84, 0.9); } /* Green */
.notification-bar.error { background-color: rgba(220, 53, 69, 0.9); } /* Red */

/* ========== Disabled Card Link Style ========== */

a.card-link.disabled-card-link {
    background-color: #adb5bd; /* Grey background */
    color: #6c757d; /* Darker grey text */
    cursor: not-allowed; /* Show disabled cursor */
    pointer-events: none; /* Prevent clicks (alternative to removing href) */
    opacity: 0.7; /* Slightly faded */
}

/* Optional: Add a tooltip style if needed, but title attribute works */
