:root {
    --primary-blue: #3a86ff;
    --secondary-blue: #2a75f0;
    --accent-teal: #06d6a0;
    --light-grey: #f0f4f8;
    --dark-grey: #333;
    --text-color: #4a4e69;
    --background-color: var(--white);
    --card-background: #fff;
    --modal-background: #fff;
    --nav-background: #fff;
}

body.dark-mode {
    --text-color: #e0e0e0;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --modal-background: #252525;
    --nav-background: #1e1e1e;
    --dark-grey: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--dark-grey);
    transition: color 0.4s ease;
}

section {
    padding: 80px 0;
}

.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation */
/* Update the main navbar container */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: var(--nav-background);
    transition: top 0.3s ease-in-out, background-color 0.4s ease;
    height: 80px;
}

/* This is a new CSS rule to contain the middle navigation links */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensure the nav-auth container is on the right */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.nav-logo i {
    margin-right: 10px;
    font-size: 2rem;
    color: var(--accent-teal);
}

/* Desktop navigation menu */
.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-grey);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-blue);
    transition: width 0.3s ease-out;
}

.nav-link:hover::after {
    width: 100%;
}

.login-btn, .register-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.login-btn {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.login-btn:hover {
    background-color: var(--primary-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.register-btn {
    background-color: var(--primary-blue);
    color: #fff;
}

.register-btn:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.hamburger:hover {
    background-color: rgba(58, 134, 255, 0.1);
}

.bar {
    width: 28px;
    height: 3px;
    background-color: var(--dark-grey);
    margin: 4px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Dark Mode Button */
.dark-mode-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--dark-grey);
    padding: 8px;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    color: var(--primary-blue);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 100px auto 50px;
    padding: 0 25px;
    text-align: center;
    min-height: 80vh;
}

.hero-content {
    max-width: 700px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: #666;
}

.cta-btn {
    padding: 15px 40px;
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(6, 214, 160, 0.3);
    transition: all 0.3s ease;
}

.cta-btn:hover {
    background-color: #05b487;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(6, 214, 160, 0.4);
}

.hero-image {
    margin-top: 50px;
}

.hero-image img {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--modal-background);
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.4s ease-out;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close:hover {
    color: var(--dark-grey);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-blue);
    font-weight: 700;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.4s, color 0.4s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.form-group input:focus + .form-help {
    color: var(--primary-blue);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:invalid + .form-help {
    color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

.form-group input:valid + .form-help {
    color: #28a745;
}

/* Dark mode support for form help text */
body.dark-mode .form-help {
    color: #aaa;
}

body.dark-mode .form-group input:focus + .form-help {
    color: var(--accent-teal);
}

body.dark-mode .form-group input:invalid + .form-help {
    color: #ff6b6b;
}

body.dark-mode .form-group input:valid + .form-help {
    color: #51cf66;
}

.form-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.form-btn:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-2px);
}

.form-footer {
    text-align: center;
    margin-top: 25px;
}

.form-footer a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Subjects Section */
.subjects {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 25px;
}

.subjects h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-description {
    text-align: center;
    margin-bottom: 50px;
    color: #666;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.subject-card {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    text-align: center;
    transition: transform 0.4s, box-shadow 0.4s, background-color 0.4s;
    cursor: pointer;
    border: 1px solid #e0e6ed;
}

.subject-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.subject-icon {
    font-size: 3.5rem;
    color: var(--accent-teal);
    margin-bottom: 20px;
}

.subject-card h3 {
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.subject-card p {
    color: #888;
    font-size: 0.95rem;
}

/* Subject Modal */
.subject-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.unit-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e6ed;
}

.unit-tab {
    padding: 12px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s, color 0.3s;
    font-weight: 500;
    color: #666;
}

.unit-tab.active {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
}

.unit-content {
    padding: 20px 0;
}

.upload-section {
    margin-bottom: 40px;
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.4s, box-shadow 0.4s;
}

.upload-section h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
}

.upload-form input,
.upload-form textarea {
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.4s, color 0.4s;
}

.upload-form button {
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s;
}

.upload-form button:hover {
    background-color: #05b487;
    transform: translateY(-2px);
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background-color: var(--card-background);
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.4s, box-shadow 0.4s;
}

.file-info h5 {
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 1.1rem;
}

.file-info p {
    font-size: 0.85rem;
    color: #888;
}

.file-description {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

.download-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.download-link:hover {
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
}

.login-required {
    color: #999;
    font-style: italic;
    padding: 5px 10px;
}

.delete-file-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.delete-file-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* My Uploads Button */
.my-uploads-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--accent-teal);
    color: #fff;
    font-size: 0.9rem;
}

.my-uploads-btn:hover {
    background-color: #05b487;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* My Uploads Modal */
.my-uploads-modal {
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
}

.uploads-content {
    margin-top: 20px;
}

.uploads-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.uploads-grid {
    display: grid;
    gap: 20px;
}

.upload-item {
    background-color: var(--card-background);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.4s, box-shadow 0.4s;
    border: 1px solid #e0e6ed;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 20px;
}

.upload-info {
    flex: 1;
}

.upload-info h4 {
    color: var(--primary-blue);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.upload-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.upload-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.upload-meta i {
    color: var(--accent-teal);
}

.upload-description {
    color: #888;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.upload-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.download-btn {
    background-color: var(--primary-blue);
    color: #fff;
}

.download-btn:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-1px);
}

.delete-btn {
    background-color: #dc3545;
    color: #fff;
}

.delete-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.no-uploads {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-uploads i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

.no-uploads h3 {
    margin-bottom: 10px;
    color: var(--dark-grey);
}

/* Dark mode support for new elements */
body.dark-mode .upload-item {
    background-color: var(--card-background);
    border-color: #555;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .upload-meta {
    color: var(--text-color);
}

body.dark-mode .upload-description {
    color: #ccc;
}

body.dark-mode .no-uploads {
    color: var(--text-color);
}

body.dark-mode .uploads-loading {
    color: var(--text-color);
}

/* About Section - Always visible */
.about {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 25px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.about h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--dark-grey);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
    padding-right: 40px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #666;
}

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

.about-text li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-color);
}

.about-text li i {
    color: var(--accent-teal);
    margin-right: 15px;
    font-size: 1.2rem;
    min-width: 20px;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: block;
}

/* Contact Section - Always visible */
.contact {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 25px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--dark-grey);
}

.contact-content {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.contact-info {
    flex: 1;
    background-color: var(--card-background);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: background-color 0.4s, box-shadow 0.4s;
}

.contact-info h3 {
    color: var(--primary-blue);
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1rem;
    color: var(--text-color);
}

.contact-info i {
    color: var(--accent-teal);
    margin-right: 15px;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.contact-form {
    flex: 1;
    background-color: var(--card-background);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: background-color 0.4s, box-shadow 0.4s;
}

.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, background-color 0.4s, color 0.4s;
    box-sizing: border-box;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.2);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .form-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.contact-form .form-btn:hover {
    background-color: #05b487;
    transform: translateY(-2px);
}

/* Dark mode support for About and Contact sections */
body.dark-mode .about-text p {
    color: #ccc !important;
}

body.dark-mode .contact-info,
body.dark-mode .contact-form {
    background-color: var(--card-background) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
    background-color: #333 !important;
    border-color: #555 !important;
    color: var(--text-color) !important;
}

body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus {
    border-color: var(--accent-teal) !important;
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2) !important;
}

/* Footer */
.footer {
    background-color: var(--dark-grey);
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 80px;
    display: block;
    visibility: visible;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section {
    display: block;
    visibility: visible;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: block;
    transition: color 0.4s ease;
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
    display: block;
    transition: color 0.4s ease;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    display: block;
}

.footer-section ul li {
    margin-bottom: 10px;
    display: block;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--accent-teal);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--accent-teal);
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
}

.social-icons a:hover {
    background-color: #05b487;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #555;
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    display: block;
    transition: border-color 0.4s ease;
}

.footer-bottom p {
    color: #ccc;
    margin: 0;
    display: block;
    transition: color 0.4s ease;
}

/* Dark mode footer styles */
body.dark-mode .footer {
    background-color: #0a0a0a;
    color: var(--text-color);
}

body.dark-mode .footer-section h3 {
    color: var(--text-color);
}

body.dark-mode .footer-section p {
    color: #aaa;
}

body.dark-mode .footer-section ul li a {
    color: #aaa;
}

body.dark-mode .footer-section ul li a:hover {
    color: var(--accent-teal);
}

body.dark-mode .footer-bottom {
    border-top-color: #333;
}

body.dark-mode .footer-bottom p {
    color: #aaa;
}

/* About and Contact - Force visibility with higher specificity */
section.about,
section.contact {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
    display: block !important;
    visibility: visible !important;
}

.about-content,
.contact-content {
    display: flex !important;
    visibility: visible !important;
}

.about-text,
.contact-info,
.contact-form {
    display: block !important;
    visibility: visible !important;
}

/* Team Section */
.team {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 25px;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.team h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark-grey);
}

.team-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-top: 50px;
}

.team-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 30px;
    flex-wrap: wrap;
}

.team-member-item {
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
}

.team-member {
    background-color: var(--card-background);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 30px 25px;
    text-align: center;
    transition: transform 0.4s, box-shadow 0.4s, background-color 0.4s;
    border: 1px solid #e0e6ed;
    min-width: 180px;
}

.team-member:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(58, 134, 255, 0.3);
}

.team-member h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: var(--dark-grey);
    font-weight: 600;
}

.team-member p {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

/* Dark mode support for team section */
body.dark-mode .team-member {
    background-color: var(--card-background);
    border-color: #555;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

body.dark-mode .team-member:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Responsive Design for Team Section */
@media (max-width: 992px) {
    .team-row {
        gap: 20px;
    }
    
    .team-member {
        min-width: 160px;
        padding: 25px 20px;
    }
    
    .member-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .team {
        padding: 0 15px;
    }
    
    .team h2 {
        font-size: 2rem;
    }
    
    .team-content {
        gap: 25px;
    }
    
    .team-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .team-member {
        min-width: 180px;
        padding: 25px 20px;
    }
    
    .member-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .team-member h3 {
        font-size: 1.1rem;
    }
}

/* Dark Mode specific styling */
body.dark-mode .navbar,
body.dark-mode .modal-content,
body.dark-mode .subject-card,
body.dark-mode .contact-content,
body.dark-mode .upload-section,
body.dark-mode .file-item {
    background-color: var(--card-background);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


body.dark-mode .nav-link {
    color: var(--text-color);
}

body.dark-mode .nav-link::after {
    background-color: var(--accent-teal);
}

body.dark-mode .form-group input,
body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea,
body.dark-mode .upload-form input,
body.dark-mode .upload-form textarea {
    background-color: #333;
    border-color: #555;
    color: var(--text-color);
}

body.dark-mode .form-group input:focus,
body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus,
body.dark-mode .upload-form input:focus,
body.dark-mode .upload-form textarea:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(6, 214, 160, 0.2);
}

body.dark-mode .form-footer a,
body.dark-mode .file-actions a,
body.dark-mode .unit-tab.active {
    color: var(--accent-teal);
}

body.dark-mode .unit-tab {
    color: var(--text-color);
    border-bottom-color: #555;
}

body.dark-mode .hamburger .bar {
    background-color: var(--text-color);
}

body.dark-mode .close {
    color: #e0e0e0;
}

/* Dark mode navigation buttons */
body.dark-mode .login-btn {
    background-color: transparent;
    color: var(--accent-teal);
    border: 2px solid var(--accent-teal);
}

body.dark-mode .login-btn:hover {
    background-color: var(--accent-teal);
    color: #fff;
}

body.dark-mode .register-btn {
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
}

body.dark-mode .register-btn:hover {
    background-color: #05b487;
}

body.dark-mode .my-uploads-btn {
    background-color: var(--accent-teal);
    color: #fff;
    border: none;
}

body.dark-mode .my-uploads-btn:hover {
    background-color: #05b487;
}

body.dark-mode .logout-btn {
    background-color: transparent;
    color: var(--accent-teal);
    border: 2px solid var(--accent-teal);
}

body.dark-mode .logout-btn:hover {
    background-color: var(--accent-teal);
    color: #fff;
}

/* Add this new CSS rule for the logout button */
.logout-btn {
    background-color: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background-color: var(--primary-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Remove any transition for these sections to prevent flickering */
.about,
.contact {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: none !important;
}

/* File upload improvements */
.file-info-text {
    margin-top: 10px;
    margin-bottom: 15px;
}

.file-info-text small {
    color: #666;
    font-style: italic;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.file-header i {
    font-size: 1.2rem;
    min-width: 20px;
}

.file-size {
    color: #888;
    font-size: 0.8rem;
    font-weight: normal;
    margin-left: auto;
}

/* File type specific colors */
.text-danger { color: #dc3545 !important; }
.text-primary { color: #007bff !important; }
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-secondary { color: #6c757d !important; }
.text-muted { color: #868e96 !important; }

/* Dark mode support for file colors */
body.dark-mode .text-danger { color: #ff6b6b !important; }
body.dark-mode .text-primary { color: #74c0fc !important; }
body.dark-mode .text-success { color: #51cf66 !important; }
body.dark-mode .text-warning { color: #ffd43b !important; }
body.dark-mode .text-secondary { color: #adb5bd !important; }
body.dark-mode .text-muted { color: #868e96 !important; }

/* Responsive Design */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        margin-top: 120px;
    }
    .hero-content {
        padding-right: 0;
        margin-bottom: 40px;
    }
    .about-content {
        flex-direction: column;
    }
    .about-text {
        padding-right: 0;
        margin-bottom: 40px;
    }
    .contact-content {
        flex-direction: column;
        gap: 40px;
    }
    
    /* Navigation adjustments for tablet */
    .navbar {
        padding: 1rem 3%;
    }
    
    .nav-auth {
        gap: 8px;
    }
    
    .login-btn, .register-btn, .my-uploads-btn, .logout-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .dark-mode-toggle {
        font-size: 1.2rem;
        padding: 6px;
    }
}

@media (max-width: 768px) {
    /* Mobile navigation */
    .navbar {
        padding: 1rem 4%;
        height: 70px;
    }
    
    .nav-left {
        z-index: 1001;
    }
    
    .nav-logo {
        font-size: 1.4rem;
    }
    
    .nav-logo i {
        font-size: 1.6rem;
    }
    
    .nav-center {
        display: none;
    }
    
    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background-color: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        transition: left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        padding: 2rem 1.5rem;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 999;
        overflow-y: auto;
        transform: none; /* Reset desktop transform */
        margin: 0; /* Reset desktop margin */
        border-right: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile menu overlay - removed for clean solid background */
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: 15px 0;
        margin-left: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 15px 20px;
        display: block;
        width: 100%;
        text-align: left;
        border-radius: 8px;
        margin: 8px 0;
        transition: all 0.3s ease;
        font-weight: 500;
        border-left: 3px solid transparent;
    }
    
    .nav-link:hover {
        background-color: rgba(58, 134, 255, 0.1);
        color: var(--primary-blue);
        border-left: 3px solid var(--primary-blue);
        transform: translateX(5px);
    }
    
    .nav-link::after {
        display: none; /* Remove underline effect on mobile */
    }
    
    .nav-auth {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    .login-btn, .register-btn, .logout-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .my-uploads-btn {
        padding: 6px 8px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .dark-mode-toggle {
        font-size: 1.1rem;
        padding: 6px;
    }
    
    .hamburger {
        display: flex;
        z-index: 1001;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hero section mobile */
    .hero {
        margin: 90px auto 30px;
        padding: 0 20px;
        min-height: 70vh;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .cta-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    /* Sections mobile */
    section {
        padding: 60px 0;
    }
    
    .subjects {
        padding: 0 20px;
    }
    
    .subjects h2,
    .about h2,
    .contact h2,
    .team h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .subject-card {
        padding: 25px 20px;
    }
    
    /* About section mobile */
    .about {
        padding: 0 20px;
    }
    
    .about-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-text {
        padding-right: 0;
    }
    
    .about-text p {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .about-text li {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    /* Contact section mobile */
    .contact {
        padding: 0 20px;
    }
    
    .contact-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .contact-info,
    .contact-form {
        padding: 30px 25px;
    }
    
    .contact-info h3 {
        font-size: 1.3rem;
        margin-bottom: 25px;
    }
    
    .contact-info p {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }
    
    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-width: 400px;
        padding: 30px 25px;
        margin: 20px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group input {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Subject modal mobile */
    .subject-modal .modal-content {
        width: 95%;
        max-width: none;
        height: 90vh;
        max-height: 90vh;
        margin: 5vh auto;
        padding: 20px;
    }
    
    .unit-tabs {
        flex-wrap: wrap;
        margin-bottom: 20px;
        gap: 5px;
    }
    
    .unit-tab {
        padding: 8px 15px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
    
    .upload-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .upload-section h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .upload-form input,
    .upload-form textarea {
        padding: 10px;
        margin-bottom: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .upload-form button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .file-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    /* My uploads modal mobile */
    .my-uploads-modal {
        width: 95%;
        max-width: none;
        height: 90vh;
        margin: 5vh auto;
        padding: 20px;
    }
    
    .upload-item {
        padding: 15px;
    }
    
    .upload-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .upload-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .upload-actions {
        gap: 8px;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Footer mobile */
    .footer {
        padding: 40px 0 20px;
        margin-top: 60px;
    }
    
    .footer-content {
        padding: 0 20px;
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .footer-section p {
        font-size: 0.9rem;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-bottom {
        margin-top: 30px;
        padding-top: 15px;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 3%;
    }
    
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .nav-logo i {
        font-size: 1.4rem;
    }
    
    .nav-auth {
        gap: 4px;
    }
    
    .login-btn, .register-btn, .logout-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .my-uploads-btn {
        padding: 5px 6px;
        font-size: 0.7rem;
    }
    
    .dark-mode-toggle {
        font-size: 1rem;
        padding: 5px;
    }
    
    .hero {
        padding: 0 15px;
        margin: 80px auto 20px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .cta-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .subjects, .about, .contact {
        padding: 0 15px;
    }
    
    .subjects h2, .about h2, .contact h2, .team h2 {
        font-size: 1.7rem;
    }
    
    .modal-content {
        padding: 25px 20px;
    }
    
    .subject-modal .modal-content,
    .my-uploads-modal {
        padding: 15px;
    }
    
    .footer-content {
        padding: 0 15px;
    }
}

/* Dark mode navbar fix */
body.dark-mode .navbar {
    background-color: var(--nav-background);
}

body.dark-mode .nav-menu {
    background-color: #1e1e1e;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
}

body.dark-mode .nav-link:hover {
    color: white;
}