body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Navbar styling */
.navbar {
    background: #004080; /* Solid blue to match your latest requirement */
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    height: 60px; /* Consistent height for desktop */
}

/* Hamburger menu styles */
.hamburger {
    display: none; /* Hidden by default for large screens */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    top: 12.5px; /* Centered vertically in 50px navbar on mobile */
    right: 20px;
    z-index: 1100;
}

.hamburger .bar {
    width: 100%;
    height: 3px;
    background-color: #fff; /* White bars for contrast */
    transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Nav menu styling */
.nav-menu {
    list-style: none;
    display: flex !important; /* Ensure visibility on all screens */
    justify-content: space-around;
    align-items: center;
    height: 60px;
    margin: 0 auto;
    max-width: 1270px;
    visibility: visible; /* Ensure not hidden */
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 20px 5px;
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
    background-color: #003366;
    color: #ffd700;
}

/* Dropdown styling */
.dropdown {
    list-style: none;
    position: absolute;
    top: 100%;
    left: -30px;
    background-color: #003366;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 8px 8px;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    color: #fff;
    text-decoration: none;
    padding: 12px 5px;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown li a:hover {
    background-color: #002244;
    color: #ffd700;
}

/* Section styling */
.section {
    min-height: 100vh;
    padding: 80px 20px 20px; /* 80px top padding to account for navbar + margin */
    background-color: #e0e0e0;
    margin-top: -10px; /* Offset to align with scroll adjustment */
    border-bottom: 1px solid #ccc;
    text-align: center;
    font-size: 24px;
}

hr {
    height: 6px;
    background-color: #004080;
    border-radius: 3px;
    width: 100%;
    margin: 16px 0 22px 0;
}

.container {
    text-align: center;
    width: 96%;
    margin: 90px auto 30px auto;
}

.contained {
    text-align: center;
    width: 96%;
    margin: 0 auto;
}

h1 {
    color: #004080;
    text-transform: uppercase;
}

h2 {
    text-transform: uppercase;
}

.buttons {
    margin-top: 20px;
}

.class-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.class-card {
    background-color: #ccccff;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.class-card a {
    text-decoration: none;
    color: #fff;
}

.class-card button {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.class-card button:hover {
    background-color: #c00;
}

.buttons a {
    padding: 10px 20px;
    margin: 10px;
    background-color: #004080;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
}

.buttons a:hover {
    background-color: #003366;
}

.login-container {
    width: 300px;
    padding: 20px;
    background-color: #fff;
    margin: 100px auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h2 {
    margin-bottom: 20px;
}

.login-container form {
    display: flex;
    flex-direction: column;
}

.login-container label {
    margin: 10px 0 5px;
}

.login-container input {
    padding: 10px;
    margin-bottom: 10px;
}

.login-container button {
    padding: 10px;
    background-color: #004080;
    color: #fff;
    border: none;
    cursor: pointer;
}

.login-container button:hover {
    background-color: #003366;
}

h1, h2, h3 {
    color: #004080;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    color: #fff;
    background-color: #004080;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #003366;
}

.dashboard {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25),
                0 12px 25px rgba(0, 0, 0, 0.10),
                inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transform: translateZ(0);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

table, th, td {
    border: 1px solid #ddd;
    color: #000;
}

td {
    background-color: none; /* Restore original background */
}

th, td {
    padding: 15px 2px;
    text-align: left;
    color: #000;
}

thead, th {
    background-color: #004080;
    color: #fff;
}

button {
    background-color: #004080; /* Green */
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px 0;
    cursor: pointer;
}

button:hover {
    background-color: #003060;
}

input[type="text"], input[type="date"], input[type="email"], input[type="file"], input[type="url"], input[type="password"], input[type="number"], textarea, select {
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    box-sizing: border-box;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #004080;
} 

#remove {
    background: #d00;
}

#remove:hover {
    background: #b00;
}

#archive {
    background: #a00;
}

#archive:hover {
    background: #800;
}

/* Scrollable containers for subjects and levels */
.scrollable-container {
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
}

/* Subject and Level Container */
.assignments-container {
    display: flex;
    align-items: stretch; /* Make both containers match the tallest height */
    gap: 20px; /* Space between the subject and level containers */
    padding: 10px; /* Space around the containers */
}

.subject-container,
.level-container {
    flex: 1; /* Equal width for both containers */
    padding: 10px; /* Space inside each container */
    background-color: #fff; /* Optional: Set background color for visibility */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), /* Deeper primary shadow */
                0 12px 40px rgba(0, 0, 0, 0.15), /* Softer, wider secondary shadow */
                inset 0 2px 4px rgba(255, 255, 255, 0.8); /* Inner highlight for depth */
    border-radius: 15px; /* Slightly larger for a smoother curve */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border for definition */
    transform: translateZ(0); /* Enable 3D rendering context */
    position: relative; /* For layering */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

/* Hover effect for interactive 3D pop */
.subject-container:hover, .level-container:hover {
    transform: translateY(-3px) translateZ(10px); /* Lift up and forward */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), /* Stronger shadow on hover */
                0 16px 50px rgba(0, 0, 0, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.7);
}

/* Styling buttons for subjects and levels */
.toggle-btn {
    display: inline-block;
    margin: 6px 4px;
    padding: 8px 13px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background-color: #004080;
    color: #fff;
    transition: background-color 0.3s;
}

.toggle-btn.selected {
    background-color: #007bff;
}

/* Headings inside each container */
.subject-container h3,
.level-container h3 {
    color: #004080;
    margin-bottom: 10px;
    text-align: center;
}

.just {
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), /* Deeper primary shadow */
                0 12px 25px rgba(0, 0, 0, 0.10), /* Softer, wider secondary shadow */
                inset 0 2px 4px rgba(255, 255, 255, 0.8); /* Inner highlight for depth */
    border-radius: 15px; /* Slightly larger for a smoother curve */
    padding: 12px;
    margin: 35px auto;
    border: none; /* Subtle border for definition */
    transform: translateZ(0); /* Enable 3D rendering context */
    position: relative; /* For layering */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

section[id^="form-"] {
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), /* Deeper primary shadow */
                0 12px 25px rgba(0, 0, 0, 0.10), /* Softer, wider secondary shadow */
                inset 0 2px 4px rgba(255, 255, 255, 0.8); /* Inner highlight for depth */
    border-radius: 15px; /* Slightly larger for a smoother curve */
    padding: 12px;
    margin: 35px auto;
    border: none; /* Subtle border for definition */
    transform: translateZ(0); /* Enable 3D rendering context */
    position: relative; /* For layering */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

/* Hover effect for interactive 3D pop */
section[id^="form-"]:hover {
    transform: translateY(-5px) translateZ(10px); /* Lift up and forward */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), /* Stronger shadow on hover */
                0 16px 50px rgba(0, 0, 0, 0.2),
                inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

section[id^="form-"] select {
    background-color: #fff;
    color: #004080;
}

section[id^="form-"] h2 {
    color: #004080;
}

section[id^="form-"] button[type=submit] {
    background-color: #004080;
    color: #fff;
    font-weight: 600;
}

/* Container for subjects, matching the style of class-container */
.subjects-container, .subjects-classes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* Styling for individual subject cards, matching the style of class-card */
.subjects-card {
    background-color: #ccccff;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Styling for the subject name inside the subjects-card */
.subjects-card span {
    color: #004080;
    margin-right: 10px;
}

/* Remove button inside subjects-card, matching the style of class-card button */
.subjects-card button {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.subjects-card button:hover {
    background-color: #c00;
}

/* Form within the container */
.subject-form {
    margin: 0;
}

/* Styling for the Add Subject button to match the Add Class button style */
#s-button {
    padding: 10px 20px;
    margin: 10px;
    background-color: #ff3300;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    cursor: pointer;
}

#s-button:hover {
    background-color: #663300;
}

/* Style for Delete Teacher Section */
.delete-teacher-section {
    margin-top: 20px;
}

.delete-teacher-section form {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: auto;
}

.delete-teacher-section label,
.delete-teacher-section select,
.delete-teacher-section button {
    margin-bottom: 10px;
}

.delete-teacher-section select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccccff;
}

.delete-teacher-section button {
    padding: 10px 20px;
    background-color: red;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.delete-teacher-section button:hover {
    background-color: #c00;
}

.delete-message {
    margin-top: 10px;
    color: #004080;
    font-weight: bold;
}

/* Wrapper for each form section */
.form-section-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

/* Style for each individual form container */
.form-container {
    flex: 1 1 48%;
    background-color: #ccccff;
    padding: 20px;
    border: 1px solid #4444ff;
    box-sizing: border-box;
    min-width: 300px; /* Ensures a minimum width for narrower screens */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45), /* Deeper primary shadow */
                0 12px 25px rgba(0, 0, 0, 0.10), /* Softer, wider secondary shadow */
                inset 0 2px 4px rgba(255, 255, 255, 0.8); /* Inner highlight for depth */
    border-radius: 2px; /* Slightly larger for a smoother curve */
    margin: 35px auto;
    transform: translateZ(0); /* Enable 3D rendering context */
    position: relative; /* For layering */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

.forms-container {
    background-color: #ccccff;
    padding: 20px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    min-width: 300px; /* Ensures a minimum width for narrower screens */
}

.form-container h3 {
    color: #004080;
    font-size: 18px;
    margin-bottom: 15px;
}

.form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-container input[type="text"],
.form-container select,
.form-container textarea, .form-container input[type="tel"], .form-container input[type="month"], .form-container input[type="datetime-local"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccccff;
}

.form-container textarea {
    resize: vertical;
    height: 80px;
}

.form-container button {
    padding: 10px;
    background-color: #004080;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
}

.form-container button:hover {
    background-color: #003366;
}

.form-contained {
    flex: 1 1 48%;
    background-color: #ccccff;
    padding: 20px;
    border: none;
    box-sizing: border-box;
    min-width: 300px; /* Ensures a minimum width for narrower screens */
    display: flex; /* Use flexbox for layout */
    flex-wrap: wrap; /* Allow wrapping into columns */
    gap: 20px; /* Space between elements */
    justify-content: space-between; /* Distribute items evenly */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25), /* Deeper primary shadow */
                0 12px 25px rgba(0, 0, 0, 0.10), /* Softer, wider secondary shadow */
                inset 0 2px 4px rgba(255, 255, 255, 0.8); /* Inner highlight for depth */
    border-radius: 15px; /* Slightly larger for a smoother curve */
    margin: 35px auto;
    transform: translateZ(0); /* Enable 3D rendering context */
    position: relative; /* For layering */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
}

.form-contained h3 {
    color: #004080;
    font-size: 18px;
    margin-bottom: 15px;
    width: 100%; /* Full width for headings */
}

.form-contained label {
    display: block;
    margin-bottom: 2px;
    font-weight: bold;
    color: #333;
    width: 100%; /* Match input width for alignment */
}

.form-contained input[type="text"],
.form-contained input[type="password"],
.form-contained input[type="email"],
.form-contained input[type="number"],
.form-contained input[type="tel"],
.form-contained input[type="file"],
.form-contained select {
    width: 48%; /* Two columns */
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    border: 1px solid #ccccff;
    box-sizing: border-box; /* Ensure padding doesn’t affect width */
}

.form-contained input[type="date"] {
    width: 100%; /* one column */
    padding: 8px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccccff;
    box-sizing: border-box; /* Ensure padding doesn’t affect width */
}

.form-contained textarea {
    resize: vertical;
    height: 80px;
    width: 100%; /* Keep textarea full width */
}

.form-contained button {
    padding: 10px;
    background-color: #004080;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%; /* Full width for button */
    font-size: 16px;
    font-weight: bold;
}

.form-contained button:hover {
    background-color: #003366;
}

/* Responsive adjustment for smaller screens */
@media (max-width: 600px) {
    .form-contained input[type="text"],
    .form-contained input[type="password"],
    .form-contained input[type="email"],
    .form-contained input[type="number"],
    .form-contained input[type="date"],
    .form-contained input[type="file"],
    .form-contained select,
    .form-contained label {
        width: 100%; /* Stack vertically on small screens */
    }
}

.message {
    color: #004080;
    font-weight: bold;
    margin-top: 10px;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.attendance-table th, .attendance-table td {
    border: 1px solid #ccc;
    padding: 10px;
}

.attendance-table th {
    background-color: #004080;
    color: #fff;
}

.attendance-table button {
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    cursor: default;
}

.attendance-table .present {
    background-color: #004080;
}

.attendance-table .absent {
    background-color: red;
}

.levels-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Lots of space between items */
    align-items: center;
}

.levels-container label {
    display: flex;
    align-items: center;
    margin: 0; /* Remove default vertical margin */
    padding: 5px 10px; /* Add some padding for breathing room */
    white-space: nowrap; /* Keep label text on one line */
}

.levels-container input[type="checkbox"] {
    margin-right: 8px; /* Space between checkbox and text */
}

.levels-container select {
    margin-left: 10px; /* Space between level name and track dropdown */
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay.active {
    display: flex;
}

.subject-button {
    background-color: #004080;
    color: white;
    padding: 18px;
    border-radius: 5px;
    display: inline-flex; /* Inline layout with flexbox */
    align-items: center;
    gap: 5px;
    margin: 12px 5px;
    white-space: nowrap; /* Prevent text wrapping */
    border: none; /* Remove default button border */
    cursor: pointer; /* Pointer cursor on hover */
    text-align: center; /* Center text in the button */
    transition: background-color 0.3s ease;
}

.subject-button:hover {
    background-color: #002050;
}

/* Responsive adjustments for small screens */
@media (max-width: 768px) {
    .navbar {
        height: 50px; /* 50px height on small screens */
    }

    .hamburger {
        display: flex; /* Show hamburger on small screens */
        top: 4px; /* Center in 50px navbar */
    }

    .nav-menu {
        display: none; /* Hide menu by default */
        position: fixed;
        top: 50px; /* Below 50px navbar */
        right: -80%;
        width: 70%;
        height: calc(100vh - 50px);
        background: #003366; /* Darker blue for menu */
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px;
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .nav-menu.active {
        display: flex; /* Show when active */
        right: 0;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

    .nav-link {
        padding: 15px;
        font-size: 18px;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: #002244; /* Darker shade for dropdown */
        box-shadow: none;
        display: none;
    }

    .nav-item:hover .dropdown,
    .nav-item.active .dropdown {
        display: block;
    }
    
    h1 {
        font-size: 22px;
    }

table {
    width: 100%;
    min-width: 348px; /* Ensure table is wide enough to require scrolling */
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    display: block; /* Allow scrolling */
}

th:nth-child(2), td:nth-child(2) {
    white-space: normal; /* Allow text wrapping for Student column */
    text-overflow: clip; /* Disable ellipsis */
    overflow: visible; /* Allow full content to be visible */
}
th:not(:nth-child(2)), td:not(:nth-child(2)) {
    white-space: nowrap; /* Prevent wrapping for other columns */
    overflow: hidden;
    text-overflow: ellipsis; /* Truncate long text for other columns */
}

    .assignments-container {
        flex-direction: column; /* Stack containers vertically */
        gap: 20px; /* Maintain spacing between stacked containers */
    }

    .subject-container,
    .level-container {
        flex: 1 1 100%; /* Full width for each container */
        width: 90%; /* Ensure full width */
    }
}