* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

body {
    background-color: #f5f7fa;
    color: #2d3748;
}

body.dark-mode {
    background-color: #121212;
    color: #e2e8f0;
}

/* Login Page Styles */
#login-page, #register-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #3b82f6, #1e3a8a);
    position: relative;
    overflow: hidden;
}

#login-page::before, #register-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15));
    z-index: 1;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    margin: 1rem;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgb(157, 177, 255);
    text-align: center;
    max-width: 405px;
    width: 100%;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
    transform: translateY(0);
}

.login-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.dark-mode .login-container {
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dark-mode .login-container:hover {
    box-shadow: 0 12px 40px rgb(216, 230, 255);
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: #1e3a8a;
    font-size: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

.login-container h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    border-radius: 3px;
}

.dark-mode .login-container h2 {
    color: #f59e0b;
}

.dark-mode .login-container h2::after {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.login-container .form-group {
    margin-bottom: 1.25rem;
}

.login-container .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1e3a8a;
}

.dark-mode .login-container .form-group label {
    color: #e2e8f0;
}

.login-container .form-group input,
.login-container .form-group select {
    width: 100%;
    padding: 0.72rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    background: #ffffff;
}

.login-container .form-group input:focus,
.login-container .form-group select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dark-mode .login-container .form-group input,
.dark-mode .login-container .form-group select {
    background: #2d3748;
    border-color: #4b5563;
    color: #e2e8f0;
}

.dark-mode .login-container .form-group input:focus,
.dark-mode .login-container .form-group select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.login-container button {
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-container button:hover {
    transform: scale(1.05);
    background: linear-gradient(90deg, #1e3a8a, #3b82f6);
}

.dark-mode .login-container button {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #1f2937;
}

.dark-mode .login-container button:hover {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

#login-error {
    color: #ef4444;
    margin-top: 0.75rem;
    font-weight: 600;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: #3b82f6;
    color: #ffffff;
    padding: 0.6rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    font-size: 1.25rem;
}

.dark-mode .theme-toggle {
    background: #f59e0b;
    color: #1f2937;
}

/* Dashboard Styles */
#dashboard {
    display: none;
    position: relative;
}

header {
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark-mode header {
    background: linear-gradient(90deg, #374151, #111827);
}

.header-content h1 {
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Side Navigation Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -250px; /* Hidden by default */
    width: 250px;
    height: 100%;
    background: rgba(246, 248, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 2px 0 10px rgba(61, 61, 61, 0.2);
    z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto; /* Enable scrollbar */
    animation: slideInDrawer 0.4s ease-out forwards;
}

.nav-drawer.open {
    left: 0;
    animation: slideInDrawer 0.4s ease-out forwards;
}

.nav-drawer:not(.open) {
    animation: slideOutDrawer 0.4s ease-out forwards;
}

.dark-mode .nav-drawer {
    background: rgba(40, 40, 40, 0.95);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
}

.nav-drawer ul {
    list-style: none;
    padding: 0;
    max-height: 100%; /* Restrict height to enable scrolling */
    overflow-y: auto; /* Enable scrollbar for ul */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #3b82f6 rgba(255, 255, 255, 0.1); /* Firefox */
}

.dark-mode .nav-drawer ul {
    scrollbar-color: #f59e0b rgba(255, 255, 255, 0.05); /* Firefox */
}

.nav-drawer ul::-webkit-scrollbar {
    width: 8px;
}

.nav-drawer ul::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-drawer ul::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f46e5, #3b82f6);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.nav-drawer ul::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6, #4f46e5);
}

.dark-mode .nav-drawer ul::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .nav-drawer ul::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.dark-mode .nav-drawer ul::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d97706, #f59e0b);
}

.nav-drawer .nav-link {
    display: block;
    color: #2d3748;
    text-decoration: none;
    font-weight: 590;
    padding: 0.73rem 1rem;
    border-radius: 6px;
    margin: 0.5rem 0;
    position: relative; /* Fix for ::after positioning */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

.dark-mode .nav-drawer .nav-link {
    color: #e2e8f0;
}

.nav-drawer .nav-link:hover {
    background: linear-gradient(90deg, #4f46e5, #3b82f6);
    color: #ffffff;
    transform: scale(1.03) translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.nav-drawer .nav-link.active {
    background: linear-gradient(90deg, #f59e0b, #eab308);
    color: #1f2937;
    transform: scale(1.03);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-drawer .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #3b82f6);
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-drawer .nav-link:hover::after {
    width: 70%;
}

.dark-mode .nav-drawer .nav-link::after {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

/* Hamburger Menu Toggle */
.nav-toggle {
    position: fixed;
    top: 1.3rem;
    left: 1.3rem;
    background: linear-gradient(90deg, #4942cfeb, #3374de);
    color: #ffffff;
    padding: 0.8rem;
    border: none;
    border-radius: 25%;
    cursor: pointer;
    z-index: 1001;
    font-size: 1.1rem;
    transition: transform 0.2s ease, background 0.3s ease;
}

.nav-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(90deg, #3b82f6, #4f46e5);
}

.dark-mode .nav-toggle {
    background: linear-gradient(90deg, #f59e0b, #eab308);
    color: #1f2937;
}

.dark-mode .nav-toggle:hover {
    background: linear-gradient(90deg, #eab308, #f59e0b);
}

/* Main Content */
main {
    padding: 2rem;
    max-width: 1290px;
    margin: 0 auto;
    transition: margin-left 0.3s ease;
}

main.nav-open {
    margin-left: 250px;
}

.section {
    display: none;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    animation: slideIn 0.5s ease forwards;
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dark-mode .section {
    background: #1f2937;
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e3a8a;
}

.dark-mode .section h2 {
    color: #f59e0b;
}

.section h3 {
    font-size: 1.25rem;
    margin: 1rem 0;
    color: #2d3748;
}

.dark-mode .section h3 {
    color: #e2e8f0;
}

.section p {
    font-size: 1rem;
    line-height: 1.75;
    color: #4b5563;
}

.dark-mode .section p {
    color: #d1d5db;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.dark-mode table {
    background: rgba(30, 30, 30, 0.95);
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.dark-mode table th, .dark-mode table td {
    border-bottom: 1px solid #4b5563;
}

table th {
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    color: #ffffff;
}

.dark-mode table th {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

table tr:hover {
    background-color: #f3f4f6;
}

.dark-mode table tr:hover {
    background-color: #374151;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e3a8a;
}

.dark-mode .form-group label {
    color: #e2e8f0;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background: #ffffff;
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background: #2d3748;
    border-color: #4b5563;
    color: #e2e8f0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus,
.dark-mode .form-group textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.form-group-inline {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

button {
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    transform: scale(1.05);
}

.dark-mode button {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #1f2937;
}

.edit-btn, .approve-btn, .reject-btn {
    background: linear-gradient(90deg, #22c55e, #15803d);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.reject-btn {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
}

.edit-btn:hover, .approve-btn:hover, .reject-btn:hover {
    transform: scale(1.05);
}

/* List Styles */
ul {
    list-style: none;
}

ul li {
    margin: 0.75rem 0;
}

ul li a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 490;
}

.dark-mode ul li a {
    color: #f59e0b;
}

ul li a:hover {
    text-decoration: underline;
}

/* Payment Message */
#payment-message {
    margin-top: 1rem;
    font-weight: 600;
    color: #22c55e;
}

/* Summary Box */
.summary-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.dark-mode .summary-box {
    background: rgba(30, 30, 30, 0.95);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    backdrop-filter: blur(10px);
}

.dark-mode .stat-card {
    background: rgba(30, 30, 30, 0.95);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #1e3a8a;
}

.dark-mode .stat-card h4 {
    color: #f59e0b;
}

.stat-card p {
    font-size: 1.25rem;
    font-weight: 600;
    color: #3b82f6;
}

.dark-mode .stat-card p {
    color: #f59e0b;
}

/* Profile Section Styles */
.profile-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-details {
    flex: 1;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.dark-mode .profile-details {
    background: linear-gradient(135deg, #374151, #1f2937);
}

.profile-pic-container {
    position: relative;
    margin: 0 auto 1rem;
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.profile-pic {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3b82f6;
}

.dark-mode .profile-pic {
    border-color: #f59e0b;
}

.profile-pic:hover {
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
}

.profile-pic-container input[type="file"] {
    display: none;
}

.profile-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: #1e3a8a;
}

.dark-mode .profile-details h3 {
    color: #f59e0b;
}

.profile-details .role {
    display: inline-block;
    background: #3b82f6;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.dark-mode .profile-details .role {
    background: #f59e0b;
    color: #1f2937;
}

.profile-details p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #4b5563;
}

.dark-mode .profile-details p {
    color: #d1d5db;
}

.profile-details p strong {
    color: #1e3a8a;
}

.dark-mode .profile-details p strong {
    color: #e2e8f0;
}

.profile-edit {
    flex: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.dark-mode .profile-edit {
    background: rgba(30, 30, 30, 0.95);
}

.profile-edit form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-edit .form-group input,
.profile-edit .form-group textarea {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 1rem;
}

.dark-mode .profile-edit .form-group input,
.dark-mode .profile-edit .form-group textarea {
    background: #2d3748;
    border-color: #4b5563;
    color: #e2e8f0;
}

/* Notification Styles */
.notification {
    background: linear-gradient(90deg, #22c55e, #15803d);
    color: #ffffff;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    animation: slideIn 0.5s ease;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInDrawer {
    0% { transform: translateX(-100%); opacity: 0.7; }
    80% { transform: translateX(5%); opacity: 0.9; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutDrawer {
    0% { transform: translateX(0); opacity: 1; }
    20% { transform: translateX(-5%); opacity: 0.9; }
    100% { transform: translateX(-100%); opacity: 0.7; }
}

/* Progress Bar Styles */
.progress-bar {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.progress {
    height: 1.25rem;
    background: linear-gradient(90deg, #3b82f6, #1e3a8a);
    text-align: center;
    color: #ffffff;
    line-height: 1.25rem;
    transition: width 0.6s ease;
}

.dark-mode .progress {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Assignment Submission Form Styles */
#assignments-student-view {
    margin-bottom: 1.5rem;
}

#submit-assignment-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.dark-mode #submit-assignment-form {
    background: rgba(30, 30, 30, 0.95);
}

#submit-assignment-form .form-group {
    margin-bottom: 1rem;
}

#submit-assignment-form select,
#submit-assignment-form input[type="file"] {
    padding: 0.75rem;
    font-size: 1rem;
}

#submit-assignment-form button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-drawer {
        width: 200px;
        left: -200px;
    }

    .nav-drawer.open {
        left: 0;
    }

    .nav-drawer ul::-webkit-scrollbar {
        width: 7px;
    }

    main.nav-open {
        margin-left: 202px;
    }

    .nav-toggle {
        display: block;
    }

    .section {
        padding: 1rem;
    }

    .header-content h1 {
        font-size: 1.6rem;
    }

    .login-container {
        padding: 2rem;
        max-width: 95%;
    }

    .form-group-inline {
        flex-direction: column;
        gap: 0.75rem;
    }

    .profile-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .nav-drawer {
        width: 190px;
        left: -190px;
    }

    .nav-drawer.open {
        left: 0;
    }

    .nav-drawer .nav-link {
        font-size: 0.850rem;
        padding: 0.75rem 0.75rem;
    }

    .nav-drawer ul::-webkit-scrollbar {
        width: 8px;
    }

    main.nav-open {
        margin-left: 190px;
    }

    .nav-toggle {
        top: 1.3rem;
        left: 1.3rem;
        padding: 0.5rem;
        font-size: 1.10rem;
        position: fixed;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem;
        font-size: 1rem;
    }

    .login-container h2 {
        font-size: 1.5rem;
    }
}