/* --- Google Fonts & Modern Resets --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Roboto:wght@400;700&display=swap');

img, video, iframe {
    max-width: 100%;
    height: auto;
}

:root {
    --mit-red: #A31F34;
    --text-black: #222222;
    --text-gray: #555555;
    --bg-gray: #F9F9F9;
    --border-gray: #DDDDDD;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- General Body & Typography --- */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
    color: var(--text-black);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    color: var(--text-black);
    font-weight: 700;
}

.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* --- Navigation Bar --- */
.navbar {
    background-color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--mit-red);
}
.navbar .logo {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-black);
    text-decoration: none;
}
.navbar .nav-links {
    list-style: none;
    display: flex;
    align-items: center; /* Ensures vertical alignment */
}
.navbar .nav-links li {
    margin-left: 25px;
}
.navbar .nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.3s ease;
}
.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: var(--mit-red);
}

/* --- Hero Section (Homepage) --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/hero-background.jpg') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 7rem 2rem;
}
.hero-content h1 {
    font-size: 3.5rem;
    color: white;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.hero-content h1 span.small-text {
    display: block;
    font-size: 0.7em;
    margin-bottom: 0;
}
.hero-content p {
    font-size: 1.4rem;
    color: white;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.6);
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* --- Page Header --- */
.page-header {
    text-align: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-gray);
    margin-bottom: 3rem;
}
.page-header h1 {
    font-size: 3rem;
}
.page-header p {
    font-size: 1.2rem;
    color: var(--text-gray);
}

/* --- Enhanced Aesthetic Profile Cards - 4 Per Row --- */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 columns */
    gap: 1rem; /* Small gap between cards */
    padding: 1rem;
    max-width: 1200px; /* Optional: limit total width */
    margin: 0 auto; /* Center the grid */
}

.profile-card {
    background: linear-gradient(145deg, #f8f8f8e3 0%, #8e8e8e 100%);
    border: none;
    border-radius: 20px;
    text-align: center;
    padding: 1.5rem 1rem; /* Reduced padding for tighter layout */
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 1px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 7px;
    background: linear-gradient(90deg, var(--mit-red) 0%, #dc3545 50%, var(--mit-red) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.profile-card:hover::before {
    transform: scaleX(1);
}

.profile-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(163, 31, 52, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(163, 31, 52, 0.05),
        transparent
    );
    transition: left 0.5s ease;
    z-index: 1;
}

.profile-card:hover::after {
    left: 100%;
}

.profile-card img {
    width: 120px; /* Slightly smaller for 4-card layout */
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 2px solid #ffffff;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(163, 31, 52, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.profile-card:hover img {
    transform: scale(1.05);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 0 0 4px rgba(163, 31, 52, 0.2);
}

.profile-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem; /* Slightly smaller font */
    font-weight: 700;
    color: #263f60;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.profile-card:hover h3 {
    color: var(--mit-red);
}

.profile-card .title {
    font-family: 'Roboto', sans-serif;
    color: var(--mit-red);
    font-weight: 600;
    font-size: 0.75rem; /* Smaller title for compact layout */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: rgba(163, 31, 52, 0.08);
    border-radius: 25px;
    display: inline-block;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.profile-card:hover .title {
    background: var(--mit-red);
    color: white;
    transform: scale(1.05);
}

.profile-card p {
    color: var(#FFFFFF);
    font-size: 0.85rem; /* Smaller text for compact layout */
    line-height: 1.4;
    margin: 0.3rem 0;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.profile-card:hover p {
    color: #495057;
}

.profile-card p strong {
    color: var(--text-black);
    font-weight: 600;
    transition: color 0.3s ease;
}

.profile-card:hover p strong {
    color: var(--mit-red);
}

/* Enhanced info section */
.profile-card .info-section {
    background: rgba(248, 249, 250, 0.7);
    border-radius: 15px;
    padding: 0.8rem;
    margin-top: 0.8rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.profile-card:hover .info-section {
    background: rgba(163, 31, 52, 0.05);
}

/* Contact info styling */
.profile-card .contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.8rem;
    position: relative;
    z-index: 2;
}

.profile-card .contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-gray);
    transition: color 0.3s ease;
}

.profile-card:hover .contact-item {
    color: #495057;
}

.profile-card .contact-item::before {
    content: '•';
    color: var(--mit-red);
    font-weight: bold;
    font-size: 1rem;
}

/* Active/Featured card variant */
.profile-card.featured {
    background: linear-gradient(145deg, var(--mit-red) 0%, #dc3545 100%);
    color: white;
}

.profile-card.featured h3,
.profile-card.featured p,
.profile-card.featured p strong {
    color: white;
}

.profile-card.featured .title {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

.profile-card.featured img {
    border-color: white;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .profile-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 cards on medium screens */
        gap: 0.8rem;
    }
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cards on tablets */
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .profile-grid {
        grid-template-columns: 2fr; /* 1 card on mobile */
        gap: 1.5rem;
        padding: 0.5rem;
    }
    
    .profile-card {
        padding: 2rem 1.5rem;
    }
    
    .profile-card img {
        width: 140px;
        height: 140px;
    }
    
    .profile-card h3 {
        font-size: 1.4rem;
    }
    
    .profile-card p {
        font-size: 0.95rem;
    }
}

/* --- Login & Register Forms (Simple Design) --- */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--bg-gray);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
}
.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}
.form-container .form-group {
    margin-bottom: 1rem;
}
.form-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.form-container input, .form-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    font-size: 1rem;
}
.form-container button[type="submit"],
.form-container button[type="button"] {
    width: 100%;
    padding: 12px;
    background-color: var(--mit-red);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-family: 'Merriweather', serif;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.form-container button[type="submit"]:hover,
.form-container button[type="button"]:hover {
    background-color: #8c1a2b; /* Darker red */
}
.form-container .form-link {
    text-align: center;
    margin-top: 1rem;
    display: block;
    color: var(--mit-red);
}
#auth-error {
    color: var(--mit-red);
    text-align: center;
    margin-bottom: 1rem;
    font-weight: bold;
}

/* --- Minimalist Link Cards & Lists --- */
/* This is a duplicate section in your provided code, I am omitting it to prevent errors */

/* --- Minimalist Footer --- */
.footer {
    background-color: var(--text-black);
    color: #cccccc;
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 4rem;
    font-size: 0.9rem;
}
.footer p {
    margin: 0.25rem 0;
}

/* --- Clean Accordion --- */
.accordion-button {
    background-color: var(--bg-gray);
    color: var(--text-black);
    cursor: pointer;
    padding: 18px;
    width: 100%;
    border: 1px solid var(--border-gray);
    text-align: left;
    outline: none;
    font-size: 1.1rem;
    font-family: 'Merriweather', serif;
    transition: background-color 0.4s ease;
    margin-top: 0.5rem;
}
.accordion-button.active, .accordion-button:hover {
    background-color: #e7e7e7;
}
.accordion-button::after { content: '+'; font-size: 1.3rem; color: var(--text-gray); float: right; }
.accordion-button.active::after { content: "−"; }
.accordion-panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border: 1px solid var(--border-gray);
    border-top: none;
}

/* --- Centered Container for Reps/Leaders --- */
.reps-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

/* --- Split Screen Login Page --- */
.auth-page-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}
.auth-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
.auth-panel.branding-panel {
    background: linear-gradient(rgba(163, 31, 52, 0.80), rgba(163, 31, 52, 0.75)), url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?q=80&w=2076&auto=format&fit=crop') no-repeat center center/cover;
    color: white;
    text-align: center;
}
.branding-panel-content {
    max-width: 400px;
}
.branding-panel-content h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1rem;
}
.branding-panel-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}
.auth-panel.form-panel {
    background-color: var(--bg-gray);
}
.form-panel .form-container {
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}
.auth-page-container ~ .footer {
    display: none;
}

/* --- Back to Home Button on Auth Pages --- */
.back-to-home-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #ffffff;
    border: 1px solid var(--border-gray);
    color: var(--text-gray);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    transition: all 0.3s ease;
    z-index: 10;
}
.back-to-home-btn:hover {
    background-color: var(--mit-red);
    color: white;
    border-color: var(--mit-red);
}

/* --- Shape Cards for Session Links --- */
.shape-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    padding: 1rem;
}
.shape-card {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 2rem;
    background-color: #ffffff;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
    color: var(--text-black);
    text-align: center;
    z-index: 1;
    transition: transform 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.shape-card::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    width: 100%;
    height: 100%;
    background-color: var(--bg-gray);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    z-index: -1;
    transition: all 0.3s ease;
}
.shape-card:hover {
    transform: translate(-6px, -6px);
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.1);
    color: white;
}
.shape-card:hover::before {
    background-color: var(--mit-red);
    border-color: var(--mit-red);
}

/* --- Updated Styles for New Homepage --- */
.navbar .logo img {
    height: 70px;
    width: auto;
}
.info-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}
.info-box {
    display: block;
    background-color: #ffffff;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    padding: 2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.info-box:hover {
    border-color: var(--mit-red);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}
.info-box h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    color: var(--text-black);
    margin-bottom: 0.5rem;
}
.info-box p {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.6;
}
.info-box .arrow-icon {
    margin-top: 1rem;
    font-weight: bold;
    color: var(--mit-red);
}

/* --- ADDED: Login/Logout Button with Shape --- */
.navbar .nav-links .login-button {
    position: relative;
    z-index: 1;
}
.navbar .nav-links .login-button a {
    display: inline-block;
    background-color: #ffffff;
    border: 1px solid var(--border-gray);
    padding: 8px 16px;
    border-radius: 4px;
    color: var(--text-black);
}
.navbar .nav-links .login-button::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 100%;
    height: 100%;
    background-color: var(--bg-gray);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    z-index: -1;
    transition: all 0.3s ease;
}
.navbar .nav-links .login-button:hover a {
    color: var(--mit-red);
    border-color: var(--mit-red);
}
.navbar .nav-links .login-button:hover::before {
    transform: translate(5px, 5px);
    background-color: var(--mit-red);
    border-color: var(--mit-red);
}
/* --- Notice Board Styles --- */
.notice-list {
    display: grid;
    gap: 2rem;
    max-width: 800px;
    margin: 2rem auto;
}

.notice-card {
    background-color: var(--bg-gray);
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.notice-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-gray);
}

.notice-card-header h3 {
    margin-bottom: 0.25rem;
}

.notice-card-header p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.notice-card-body {
    padding: 1.5rem;
}

.notice-card-body p {
    font-size: 1rem;
    line-height: 1.7;
}

.notice-card-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.notice-card-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 4px;
}

.notice-pdf-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--mit-red);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.notice-pdf-link:hover {
    background-color: #8c1a2b; /* Darker red */
}
/* --- Tab Navigation --- */
.tab-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-gray);
}

.tab-link {
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    color: var(--text-gray);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    border-bottom: 3px solid transparent; /* Important for the active effect */
    transition: all 0.3s ease;
    transform: translateY(1px); /* Aligns with the bottom border */
}

.tab-link:hover {
    color: var(--text-black);
}

.tab-link.active {
    color: var(--mit-red);
    border-bottom-color: var(--mit-red);
}

/* --- Tab Content --- */
.tab-content {
    display: none; /* Hide all tab content by default */
}

.tab-content.active {
    display: block; /* Show only the active tab's content */
}
/* Removes the default underline and color from the profile links */
.profile-link {
    text-decoration: none;
    color: inherit;
    display: block; /* Makes the entire card area clickable */
}

/* ===== GLOBAL PAGE TRANSITION ANIMATIONS =====
   Add this section to your style.css file */

/* Base page load animation - applies to all pages */
body {
    animation: pageLoad 0.6s ease-out;
}

/* Page transition keyframes */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Alternative slide animations */
@keyframes slideInFromRight {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading overlay for smooth transitions between pages */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.page-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--mit-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced transitions for auth pages */
.auth-page-container {
    animation: pageLoad 0.8s ease-out;
}

.auth-panel.form-panel {
    animation: slideInFromRight 0.8s ease-out;
}

.auth-panel.branding-panel {
    animation: slideInFromLeft 0.8s ease-out;
}

/* Staggered animations for form elements */
.form-container > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-container > *:nth-child(1) { animation-delay: 0.1s; }
.form-container > *:nth-child(2) { animation-delay: 0.2s; }
.form-container > *:nth-child(3) { animation-delay: 0.3s; }
.form-container > *:nth-child(4) { animation-delay: 0.4s; }
.form-container > *:nth-child(5) { animation-delay: 0.5s; }
.form-container > *:nth-child(6) { animation-delay: 0.6s; }
.form-container > *:nth-child(7) { animation-delay: 0.7s; }

/* Navigation and link hover effects */
.back-to-home-btn, 
.form-link, 
nav a, 
.btn {
    transition: all 0.3s ease;
}

.back-to-home-btn:hover,
.form-link:hover {
    transform: translateY(-2px);
}

.back-to-home-btn:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Button animations */
button, 
input[type="submit"], 
.btn {
    transition: all 0.2s ease;
}

button:hover, 
input[type="submit"]:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 31, 52, 0.3);
}

button:active, 
input[type="submit"]:active,
.btn:active {
    transform: translateY(1px);
}

/* Input field focus effects */
input:focus, 
textarea:focus, 
select:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(163, 31, 52, 0.1);
    transition: all 0.3s ease;
}

/* Error message animations */
.error-message, 
#auth-error,
.alert-error {
    transition: all 0.3s ease;
    transform: translateY(-10px);
    opacity: 0;
}

.error-message:not(:empty), 
#auth-error:not(:empty),
.alert-error:not(:empty) {
    transform: translateY(0);
    opacity: 1;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
}

/* Success message animations */
.success-message,
.alert-success {
    animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Page exit animation class (applied via JavaScript) */
.page-exit {
    animation: pageExit 0.4s ease-in forwards;
}

/* Different page entry animations based on page type */
.page-home .main-content {
    animation: slideInFromBottom 0.8s ease-out;
}

.page-about .content-section {
    animation: fadeInUp 0.8s ease-out;
}

.page-contact .contact-form {
    animation: slideInFromRight 0.8s ease-out;
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile for performance */
    body {
        animation-duration: 0.4s;
    }
    
    .auth-panel.form-panel,
    .auth-panel.branding-panel {
        animation-duration: 0.6s;
    }
    
    .form-container > * {
        animation-duration: 0.4s;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* ======================================= */
/* ===== NEW HAMBURGER MENU STYLES ===== */
/* ======================================= */

/* ===================================
   PREMIUM HAMBURGER MENU
   =================================== */

/* --- Hamburger Button --- */
.hamburger {
    display: none;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    padding: 12px;
    z-index: 1002;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.hamburger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.hamburger:focus {
    outline: 2px solid var(--primary-color, #dc3545);
    outline-offset: 2px;
}

.hamburger-bar {
    display: block;
    width: 28px;
    height: 3px;
    margin: 6px 0;
    background-color: var(--text-black, #1a1a1a);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* --- Mobile Navigation Overlay --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    /* Backdrop overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        z-index: 999;
    }

    .nav-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Navigation Sidebar */
    .navbar .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(85%, 360px);
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
        
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 5rem 0 2rem;
        overflow-y: auto;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }

    /* Slide menu in when active */
    .nav-links.is-active {
        right: 0;
    }

    /* Mobile menu items */
    .navbar .nav-links li {
        margin: 0;
        width: 100%;
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Staggered animation for menu items */
    .nav-links.is-active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.is-active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.is-active li:nth-child(2) { transition-delay: 0.15s; }
    .nav-links.is-active li:nth-child(3) { transition-delay: 0.2s; }
    .nav-links.is-active li:nth-child(4) { transition-delay: 0.25s; }
    .nav-links.is-active li:nth-child(5) { transition-delay: 0.3s; }
    .nav-links.is-active li:nth-child(6) { transition-delay: 0.35s; }
    .nav-links.is-active li:nth-child(7) { transition-delay: 0.4s; }
    .nav-links.is-active li:nth-child(8) { transition-delay: 0.45s; }
    .nav-links.is-active li:nth-child(9) { transition-delay: 0.5s; }

    .navbar .nav-links a {
        display: block;
        padding: 1.2rem 2rem 1.2rem 2.5rem !important;
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--text-black, #1a1a1a);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    /* Hover effect for mobile menu items */
    .navbar .nav-links a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 0;
        background: var(--primary-color, #dc3545);
        transition: width 0.3s ease;
    }

    .navbar .nav-links a:hover::before,
    .navbar .nav-links a.active::before {
        width: 5px;
    }

    .navbar .nav-links li a:hover {
        background-color: transparent !important;
        color: inherit !important;
        padding-left: 3rem;
    }

    .navbar .nav-links li a.active {
        background-color: transparent !important;
        color: var(--primary-color, #dc3545) !important;
        font-weight: 600;
    }

    /* Login button special styling */
    .navbar .nav-links .login-button {
        margin-top: auto;
        padding-top: 1rem;
        border-top: 2px solid rgba(0, 0, 0, 0.1);
    }

    .navbar .nav-links .login-button a {
        background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
        color: white !important;
        margin: 1rem 1.5rem;
        padding: 1rem;
        border-radius: 12px;
        text-align: center;
        font-weight: 600;
        border: none;
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
        transition: all 0.3s ease;
    }

    .navbar .nav-links .login-button a::before {
        display: none;
    }

    .navbar .nav-links .login-button a:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
        padding: 1rem !important;
        background: linear-gradient(135deg, #e63946 0%, #c02a37 100%);
        color: white !important;
    }

    /* Hamburger animation to X */
    .hamburger.is-active .hamburger-bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.is-active .hamburger-bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger.is-active .hamburger-bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* --- Small Mobile (portrait phones) --- */
@media (max-width: 480px) {
    .navbar .nav-links {
        width: 90%;
    }

    .navbar .nav-links a {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

/* --- Dark Theme Support --- */
@media (max-width: 768px) {
    [data-theme="dark"] .navbar .nav-links {
        background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    }

    [data-theme="dark"] .navbar .nav-links a {
        color: #ffffff;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .navbar .nav-links li a:hover {
        background-color: transparent !important;
        color: #ffffff !important;
    }

    [data-theme="dark"] .navbar .nav-links li a.active {
        background-color: transparent !important;
        color: #dc3545 !important;
    }

    [data-theme="dark"] .hamburger:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .hamburger-bar {
        background-color: #ffffff;
    }
}
/* =====================================
   DARK THEME SUPPORT
   Add this to the end of your style.css
   ===================================== */

/* Updated CSS Variables for Theme Support */
/* =====================================
   UPDATED DARK THEME SUPPORT
   Replace the existing dark theme section in your style.css with this
   ===================================== */

/* Updated CSS Variables for Theme Support */
:root {
    --mit-red: #A31F34;
    --text-black: #222222;
    --text-gray: #555555;
    --bg-gray: #F9F9F9;
    --border-gray: #DDDDDD;
    
    /* Light theme variables */
    --bg-primary: #ffffff;
    --bg-secondary: #F9F9F9;
    --text-primary: #222222;
    --text-secondary: #555555;
    --border-primary: #DDDDDD;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
    --footer-bg: #222222;
    --footer-text: #cccccc;
    --accent-primary: #A31F34;
    --accent-secondary: #8c1a2b;
    --accent-hover: #dc3545;
}

/* Dark theme variables with your custom palette */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-tertiary: #808080;
    --border-primary: #2A2A2A;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --card-bg: #1E1E1E;
    --nav-bg: #121212;
    --footer-bg: #0D0D0D;
    --footer-text: #B0B0B0;
    --bg-gray: #1E1E1E;
    --accent-primary: #D32F2F;
    --accent-secondary: #E53935;
    --accent-hover: #FF5A5A;
}

/* Theme Toggle Button Styles */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle svg {
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: scale(1.1);
}

/* --- Dark Theme Form Input Fix --- */
.dark-theme .search-form input,
.dark-theme .search-form select {
  background-color: #2d2d2d; /* A dark background for the input fields */
  color: #f1f1f1;            /* Light text color for readability */
  border: 1px solid #555;   /* A slightly lighter border */
}

/* Optional: Style the placeholder text in dark mode */
.dark-theme .search-form input::placeholder {
  color: #888; /* A dimmer color for placeholder text */
}
/* Apply theme variables to existing elements */

/* Body and basic elements */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Navigation */
.navbar {
    background-color: var(--nav-bg);
    border-bottom: 2px solid var(--accent-primary);
}

.navbar .logo {
    color: var(--text-primary);
}

.navbar .nav-links a {
    color: var(--text-secondary);
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    color: var(--accent-primary);
}

/* Page elements */
.page-header h1,
.page-header h2 {
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-secondary);
}

/* Profile cards - Dark theme support */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    box-shadow: 0 10px 30px var(--shadow-color), 0 1px 8px var(--shadow-color);
}

.profile-card h3 {
    color: var(--text-primary);
}

.profile-card p {
    color: var(--text-secondary);
}

.profile-card p strong {
    color: var(--text-primary);
}

.profile-card .info-section {
    background: var(--bg-secondary);
}

.profile-card .title {
    background: rgba(211, 47, 47, 0.15);
    color: var(--accent-primary);
}

[data-theme="dark"] .profile-card:hover .title {
    background: var(--accent-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .profile-card:hover {
    box-shadow: 0 25px 50px rgba(211, 47, 47, 0.3), 0 10px 30px var(--shadow-color);
}

[data-theme="dark"] .profile-card:hover h3 {
    color: var(--accent-hover);
}

[data-theme="dark"] .profile-card:hover p {
    color: var(--text-secondary);
}

[data-theme="dark"] .profile-card:hover p strong {
    color: var(--accent-primary);
}

/* Forms */
.form-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
}

.form-container h2 {
    color: var(--text-primary);
}

.form-container label {
    color: var(--text-primary);
}

.form-container input, 
.form-container select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.form-container input:focus, 
.form-container select:focus {
    border-color: var(--accent-primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Button updates for dark theme */
.form-container button[type="submit"],
.form-container button[type="button"] {
    background-color: var(--accent-primary);
    color: #FFFFFF;
}

.form-container button[type="submit"]:hover,
.form-container button[type="button"]:hover {
    background-color: var(--accent-hover);
}

/* Info boxes */
.info-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
}

.info-box:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.info-box h3 {
    color: var(--text-primary);
}

.info-box p {
    color: var(--text-secondary);
}

.info-box .arrow-icon {
    color: var(--accent-primary);
}

/* Shape cards */
.shape-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.shape-card::before {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.shape-card:hover::before {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Notice cards */
.notice-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
}

.notice-card-header {
    border-bottom: 1px solid var(--border-primary);
}

.notice-card-header h3 {
    color: var(--text-primary);
}

.notice-card-header p {
    color: var(--text-secondary);
}

.notice-card-body p {
    color: var(--text-primary);
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
}

/* Accordion */
.accordion-button {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.accordion-button.active,
.accordion-button:hover {
    background-color: var(--border-primary);
}

.accordion-button::after {
    color: var(--text-secondary);
}

.accordion-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

/* Tab navigation */
.tab-nav {
    border-bottom: 1px solid var(--border-primary);
}

.tab-link {
    color: var(--text-secondary);
}

.tab-link:hover {
    color: var(--text-primary);
}

.tab-link.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Login button shape effect */
.navbar .nav-links .login-button a {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.navbar .nav-links .login-button::before {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.navbar .nav-links .login-button:hover a {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.navbar .nav-links .login-button:hover::before {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Statistics section - Dark theme */
[data-theme="dark"] .stats-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

[data-theme="dark"] .stat-item {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .stat-number {
    color: var(--accent-primary);
}

[data-theme="dark"] .stat-label {
    color: var(--text-secondary);
}

/* Features section - Dark theme */
[data-theme="dark"] .features-section {
    background: var(--bg-primary);
}

[data-theme="dark"] .feature-card {
    background: var(--card-bg);
    border-top: 4px solid var(--accent-primary);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .feature-card:hover {
    box-shadow: 0 15px 40px rgba(211, 47, 47, 0.2);
}

[data-theme="dark"] .feature-card h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .feature-card p {
    color: var(--text-secondary);
}

[data-theme="dark"] .feature-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
}

/* About preview - Dark theme */
[data-theme="dark"] .about-preview {
    background: var(--bg-secondary);
}

[data-theme="dark"] .about-content h2 {
    color: var(--text-primary);
}

[data-theme="dark"] .about-content p {
    color: var(--text-secondary);
}

[data-theme="dark"] .highlight-item {
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] .highlight-item h4 {
    color: var(--accent-primary);
}

[data-theme="dark"] .highlight-item p {
    color: var(--text-secondary);
}

/* CTA Section - Dark theme */
[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

[data-theme="dark"] .cta-button {
    background: #FFFFFF;
    color: var(--accent-primary);
}

[data-theme="dark"] .cta-button:hover {
    background: var(--bg-secondary);
    color: #FFFFFF;
}

[data-theme="dark"] .cta-button.secondary {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
}

[data-theme="dark"] .cta-button.secondary:hover {
    background: #FFFFFF;
    color: var(--accent-primary);
}

/* Auth page branding panel - Dark theme adjustments */
[data-theme="dark"] .auth-panel.branding-panel {
    background: linear-gradient(rgba(211, 47, 47, 0.90), rgba(229, 57, 53, 0.85)), url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?q=80&w=2076&auto=format&fit=crop') no-repeat center center/cover;
}

/* Mobile hamburger menu - Dark theme */
@media (max-width: 768px) {
    [data-theme="dark"] .navbar .nav-links {
        background-color: var(--nav-bg);
        box-shadow: -5px 0 15px var(--shadow-color);
    }
    
    [data-theme="dark"] .navbar .nav-links a {
        border-bottom: 1px solid var(--border-primary);
    }
    
    .theme-toggle {
        margin-right: 0.5rem;
        padding: 6px;
    }
    
    [data-theme="dark"] .hamburger-bar {
        background-color: var(--text-primary);
    }
}

/* Smooth theme transition */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Override transitions for elements that shouldn't animate */
.hero,
.hero-content,
.cta-section,
.profile-card img,
.theme-toggle svg {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* Dark theme adjustments for hero section */
[data-theme="dark"] .hero {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('images/hero-background.jpg') no-repeat center center/cover;
}
/* =====================================
   FORCE LIGHT MODE FOR UPDATE PASSWORD PAGE
   ===================================== */
/* Override all dark theme styles for update-password.html */
body.update-password-page,
body.update-password-page *,
[data-theme="dark"] body.update-password-page,
[data-theme="dark"] body.update-password-page * {
    /* Force light theme colors */
    --bg-primary: #ffffff !important;
    --bg-secondary: #F9F9F9 !important;
    --text-primary: #222222 !important;
    --text-secondary: #555555 !important;
    --border-primary: #DDDDDD !important;
    --shadow-color: rgba(0, 0, 0, 0.1) !important;
    --card-bg: #ffffff !important;
    --nav-bg: #ffffff !important;
    --accent-primary: #A31F34 !important;
    --accent-secondary: #8c1a2b !important;
    --accent-hover: #dc3545 !important;
}

[data-theme="dark"] body.update-password-page {
    background-color: #ffffff !important;
    color: #222222 !important;
}

[data-theme="dark"] body.update-password-page .auth-page-container {
    background-color: #ffffff !important;
}

[data-theme="dark"] body.update-password-page .auth-panel.branding-panel {
    background: linear-gradient(rgba(163, 31, 52, 0.80), rgba(163, 31, 52, 0.75)), url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?q=80&w=2076&auto=format&fit=crop') no-repeat center center/cover !important;
    color: white !important;
}

[data-theme="dark"] body.update-password-page .branding-panel-content h1,
[data-theme="dark"] body.update-password-page .branding-panel-content p {
    color: white !important;
}

[data-theme="dark"] body.update-password-page .auth-panel.form-panel {
    background-color: #F9F9F9 !important;
}

[data-theme="dark"] body.update-password-page .form-container {
    background-color: #ffffff !important;
    border: 1px solid #DDDDDD !important;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1) !important;
}

[data-theme="dark"] body.update-password-page .form-container h2 {
    color: #222222 !important;
}

[data-theme="dark"] body.update-password-page .form-container label {
    color: #222222 !important;
}

[data-theme="dark"] body.update-password-page .form-container input {
    background-color: #ffffff !important;
    border: 1px solid #DDDDDD !important;
    color: #222222 !important;
}

[data-theme="dark"] body.update-password-page .form-container input:focus {
    border-color: #A31F34 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(163, 31, 52, 0.1) !important;
}

[data-theme="dark"] body.update-password-page .form-container input::placeholder {
    color: #555555 !important;
}

[data-theme="dark"] body.update-password-page .form-container button {
    background-color: #A31F34 !important;
    color: white !important;
}

[data-theme="dark"] body.update-password-page .form-container button:hover {
    background-color: #8c1a2b !important;
}

[data-theme="dark"] body.update-password-page #auth-error {
    color: #A31F34 !important;
}

[data-theme="dark"] body.update-password-page #auth-message {
    color: green !important;
}

/* Error and success messages for dark theme */
#auth-error {
    color: var(--accent-hover);
}

[data-theme="dark"] .success-message,
[data-theme="dark"] .alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    color: #4CAF50;
}

[data-theme="dark"] .error-message,
[data-theme="dark"] .alert-error {
    background-color: rgba(255, 90, 90, 0.1);
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

/* Input placeholder text color for dark theme */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-tertiary);
}

[data-theme="dark"] input:focus::placeholder,
[data-theme="dark"] textarea:focus::placeholder {
    color: var(--text-secondary);
}

/* Scrollbar styling for dark theme */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Additional dark theme improvements */

/* Links styling */
[data-theme="dark"] a {
    color: var(--accent-primary);
}

[data-theme="dark"] a:hover {
    color: var(--accent-hover);
}

/* Selection styling */
[data-theme="dark"] ::selection {
    background: rgba(211, 47, 47, 0.3);
    color: var(--text-primary);
}

/* Focus outline for accessibility */
[data-theme="dark"] button:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .theme-toggle:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* PDF link styling for dark theme */
[data-theme="dark"] .notice-pdf-link {
    background-color: var(--accent-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .notice-pdf-link:hover {
    background-color: var(--accent-hover);
}

/* Featured profile card variant for dark theme */
[data-theme="dark"] .profile-card.featured {
    background: linear-gradient(145deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #FFFFFF;
}

[data-theme="dark"] .profile-card.featured h3,
[data-theme="dark"] .profile-card.featured p,
[data-theme="dark"] .profile-card.featured p strong {
    color: #FFFFFF;
}

[data-theme="dark"] .profile-card.featured .title {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* Table styling for dark theme (if you have any) */
[data-theme="dark"] table {
    background-color: var(--card-bg);
    border: 1px solid var(--border-primary);
}

[data-theme="dark"] th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
}

[data-theme="dark"] td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

[data-theme="dark"] tr:hover {
    background-color: rgba(211, 47, 47, 0.05);
}
/* =====================================
   DARK THEME TEXT VISIBILITY FIXES
   Add this CSS to your existing dark theme section
   ===================================== */

/* Fix section headings that are barely visible */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

/* Fix page header text */
[data-theme="dark"] .page-header h1,
[data-theme="dark"] .page-header h2,
[data-theme="dark"] .page-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .page-header p {
    color: var(--text-secondary) !important;
}

/* Fix faculty section headings (Dean, Chairman, etc.) */
[data-theme="dark"] .faculty-section h2,
[data-theme="dark"] .faculty-section h3,
[data-theme="dark"] .faculty-category h2,
[data-theme="dark"] .faculty-category h3 {
    color: var(--text-primary) !important;
}

/* Fix any text that might be using the old CSS variables */
[data-theme="dark"] .text-black {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-gray {
    color: var(--text-secondary) !important;
}

/* Fix shape card text (Question Bank cards) */
[data-theme="dark"] .shape-card {
    color: var(--text-primary) !important;
}

/* Fix shape card hover state text */
[data-theme="dark"] .shape-card:hover {
    color: #FFFFFF !important;
}

/* Fix accordion content that's invisible */
[data-theme="dark"] .accordion-panel {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .accordion-panel p,
[data-theme="dark"] .accordion-panel div,
[data-theme="dark"] .accordion-panel span,
[data-theme="dark"] .accordion-panel li,
[data-theme="dark"] .accordion-panel a {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .accordion-panel a:hover {
    color: var(--accent-hover) !important;
}

/* Fix any content areas that might be using body text color */
[data-theme="dark"] .content,
[data-theme="dark"] .main-content,
[data-theme="dark"] .page-content {
    color: var(--text-primary) !important;
}

/* Fix all paragraph text */
[data-theme="dark"] p {
    color: var(--text-secondary) !important;
}

/* Fix specific results page content */
[data-theme="dark"] .results-content,
[data-theme="dark"] .results-section,
[data-theme="dark"] .batch-results {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .results-content p,
[data-theme="dark"] .results-section p,
[data-theme="dark"] .batch-results p {
    color: var(--text-secondary) !important;
}

/* Fix table content if you have any */
[data-theme="dark"] table,
[data-theme="dark"] table td,
[data-theme="dark"] table th {
    color: var(--text-primary) !important;
    background-color: var(--card-bg) !important;
    border-color: var(--border-primary) !important;
}

[data-theme="dark"] table th {
    background-color: var(--bg-secondary) !important;
}

/* Fix list items */
[data-theme="dark"] ul,
[data-theme="dark"] ol,
[data-theme="dark"] li {
    color: var(--text-secondary) !important;
}

/* Fix any form labels and text */
[data-theme="dark"] label,
[data-theme="dark"] .form-label {
    color: var(--text-primary) !important;
}

/* Fix description text and secondary information */
[data-theme="dark"] .description,
[data-theme="dark"] .subtitle,
[data-theme="dark"] .meta,
[data-theme="dark"] .info {
    color: var(--text-secondary) !important;
}

/* Fix any divider text */
[data-theme="dark"] .divider-text,
[data-theme="dark"] .section-divider {
    color: var(--text-secondary) !important;
}

/* Fix breadcrumb navigation if you have any */
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .breadcrumb-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .breadcrumb a {
    color: var(--accent-primary) !important;
}

/* Fix any modal or popup content */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .popup {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

/* Fix any alert or notification text */
[data-theme="dark"] .alert,
[data-theme="dark"] .notification {
    color: var(--text-primary) !important;
}

/* Fix code blocks if you have any */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

/* Fix any card titles and content */
[data-theme="dark"] .card-title,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-text,
[data-theme="dark"] .card-description {
    color: var(--text-secondary) !important;
}

/* Fix timestamp and date text */
[data-theme="dark"] .timestamp,
[data-theme="dark"] .date,
[data-theme="dark"] .posted-on {
    color: var(--text-secondary) !important;
}

/* Fix any sidebar content */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-content {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Fix dropdown menus */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .dropdown-item {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-secondary) !important;
    color: var(--accent-primary) !important;
}

/* Fix any remaining text that might be invisible */
[data-theme="dark"] div,
[data-theme="dark"] span,
[data-theme="dark"] section,
[data-theme="dark"] article {
    color: inherit;
}

/* Ensure all direct text content is visible */
[data-theme="dark"] body,
[data-theme="dark"] body * {
    color: inherit;
}

[data-theme="dark"] body {
    color: var(--text-primary);
}

/* Fix specific content containers */
[data-theme="dark"] .container,
[data-theme="dark"] .content-wrapper,
[data-theme="dark"] .main-wrapper {
    color: var(--text-primary);
}

/* Emergency fix for any completely invisible text */
[data-theme="dark"] * {
    /* Only apply if current color is very dark (likely invisible) */
}

/* Fix for elements that might be inheriting wrong colors */
[data-theme="dark"] [style*="color: #222"],
[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color: black"] {
    color: var(--text-primary) !important;
}

[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color: #777"] {
    color: var(--text-secondary) !important;
}

/* Fix any remaining issues with specific sections */
[data-theme="dark"] .faculty-grid h3,
[data-theme="dark"] .results-grid h3,
[data-theme="dark"] .question-grid h3 {
    color: var(--text-primary) !important;
}

/* Fix content that might be using CSS custom properties incorrectly */
[data-theme="dark"] * {
    --text-black: var(--text-primary);
    --text-gray: var(--text-secondary);
}
/* Invert the single-colored PNG logo in dark mode */
[data-theme="dark"] .logo img {
  filter: invert(1) brightness(100%) contrast(100%);
  -webkit-filter: invert(1) brightness(100%) contrast(100%);
  transition: filter 0.25s ease;
}
/* =====================================
   HOVER STATE AND PROFILE CARD TEXT FIXES
   Add this to your dark theme CSS section
   ===================================== */

/* Fix accordion button hover states */
[data-theme="dark"] .accordion-button {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .accordion-button:hover {
    background-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .accordion-button.active {
    background-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .accordion-button.active:hover {
    background-color: var(--accent-hover) !important;
    color: #FFFFFF !important;
}

/* Fix profile card text visibility */
[data-theme="dark"] .profile-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-card h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-card .profile-name,
[data-theme="dark"] .profile-card .student-name {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-card p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .profile-card p strong {
    color: var(--text-primary) !important;
}

/* Fix profile card hover states */
[data-theme="dark"] .profile-card:hover {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-card:hover h3 {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .profile-card:hover p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .profile-card:hover p strong {
    color: var(--accent-primary) !important;
}

/* Fix any profile image containers */
[data-theme="dark"] .profile-image-container,
[data-theme="dark"] .student-avatar {
    background-color: var(--bg-secondary) !important;
}

/* Fix modal/popup profile cards */
[data-theme="dark"] .profile-modal,
[data-theme="dark"] .profile-popup {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-modal h3,
[data-theme="dark"] .profile-popup h3,
[data-theme="dark"] .profile-modal .student-name,
[data-theme="dark"] .profile-popup .student-name {
    color: var(--text-primary) !important;
}

/* Fix any student information text */
[data-theme="dark"] .student-id,
[data-theme="dark"] .student-email,
[data-theme="dark"] .student-number {
    color: var(--text-secondary) !important;
}

/* Fix contact information in profile cards */
[data-theme="dark"] .contact-info {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .contact-info strong {
    color: var(--text-primary) !important;
}

/* Fix any title or subtitle text in profiles */
[data-theme="dark"] .profile-title,
[data-theme="dark"] .profile-subtitle {
    color: var(--text-secondary) !important;
}

/* Fix buttons in profile cards */
[data-theme="dark"] .profile-card button,
[data-theme="dark"] .profile-card .btn {
    background-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
    border: 1px solid var(--accent-primary) !important;
}

[data-theme="dark"] .profile-card button:hover,
[data-theme="dark"] .profile-card .btn:hover {
    background-color: var(--accent-hover) !important;
    color: #FFFFFF !important;
}

/* Fix any links in profile cards */
[data-theme="dark"] .profile-card a {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .profile-card a:hover {
    color: var(--accent-hover) !important;
}

/* Fix the specific issues from screenshots */

/* Results page accordion fixes */
[data-theme="dark"] .accordion-button[style*="background"] {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Profile card specific fixes for student information */
[data-theme="dark"] .profile-card .student-details,
[data-theme="dark"] .profile-card .student-info {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .profile-card .student-details h3,
[data-theme="dark"] .profile-card .student-info h3,
[data-theme="dark"] .profile-card .student-details h4,
[data-theme="dark"] .profile-card .student-info h4 {
    color: var(--text-primary) !important;
}

/* Fix any gradient overlays that might be causing text invisibility */
[data-theme="dark"] .profile-card::before,
[data-theme="dark"] .profile-card::after {
    background: none !important;
}

[data-theme="dark"] .profile-card:hover::before,
[data-theme="dark"] .profile-card:hover::after {
    background: linear-gradient(90deg, transparent, rgba(211, 47, 47, 0.05), transparent) !important;
}

/* Fix any text that might be getting overridden by inline styles */
[data-theme="dark"] .profile-card [style*="color: white"],
[data-theme="dark"] .profile-card [style*="color: #fff"],
[data-theme="dark"] .profile-card [style*="color: #ffffff"] {
    color: var(--text-primary) !important;
}

/* Emergency fix for completely invisible text */
[data-theme="dark"] .profile-card * {
    text-shadow: none !important;
}

/* Fix specific accordion states that might be problematic */
[data-theme="dark"] .accordion-button[aria-expanded="true"] {
    background-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .accordion-button[aria-expanded="false"] {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .accordion-button[aria-expanded="false"]:hover {
    background-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* Fix for cards that might be inheriting wrong background colors */
[data-theme="dark"] .card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .student-card {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Fix any remaining text visibility issues */
[data-theme="dark"] .text-content,
[data-theme="dark"] .content-text,
[data-theme="dark"] .display-text {
    color: var(--text-primary) !important;
}
/* =====================================
   PROFILE PAGE DARK THEME SPECIFIC FIXES
   Add this to your dark theme CSS section
   ===================================== */

/* Fix profile page container and content */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
}

[data-theme="dark"] .profile-container {
    background: var(--card-bg) !important;
    box-shadow: 0 25px 50px var(--shadow-color) !important;
}

[data-theme="dark"] .profile-container::before {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
}

[data-theme="dark"] .profile-content-wrapper {
    color: var(--text-primary) !important;
}

/* Fix the specific student name element */
[data-theme="dark"] .profile-info h1,
[data-theme="dark"] #student-name {
    color: var(--text-primary) !important;
}

/* Fix all profile information text */
[data-theme="dark"] .profile-info p,
[data-theme="dark"] #student-id,
[data-theme="dark"] #student-email,
[data-theme="dark"] #student-number {
    color: var(--text-secondary) !important;
}

/* Fix loading message */
[data-theme="dark"] #loading-message {
    color: var(--text-secondary) !important;
}

/* Fix error message */
[data-theme="dark"] #error-message {
    background: rgba(211, 47, 47, 0.1) !important;
    color: var(--accent-hover) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

/* Fix modal styles for dark theme */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content h2 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content input {
    background: var(--bg-primary) !important;
    border: 2px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content input:focus {
    border-color: var(--accent-primary) !important;
    background: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

[data-theme="dark"] .modal-content input[type="file"] {
    background: var(--bg-primary) !important;
    border: 2px dashed var(--border-primary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .modal-content input[type="file"]:hover {
    border-color: var(--accent-primary) !important;
}

[data-theme="dark"] .modal-content input::placeholder {
    color: var(--text-tertiary) !important;
}

/* Fix button styles */
[data-theme="dark"] #edit-button {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3) !important;
}

[data-theme="dark"] #edit-button:hover {
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.4) !important;
}

[data-theme="dark"] .modal-content button[type="submit"] {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3) !important;
}

[data-theme="dark"] .modal-content button[type="submit"]:hover {
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.4) !important;
}

[data-theme="dark"] #cancel-edit {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    border: 2px solid var(--border-primary) !important;
}

[data-theme="dark"] #cancel-edit:hover {
    background: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

/* Fix profile image border */
[data-theme="dark"] .profile-image {
    border: 6px solid var(--card-bg) !important;
    box-shadow: 0 15px 35px var(--shadow-color) !important;
}

/* Additional specificity for stubborn elements */
[data-theme="dark"] .profile-container .profile-content-wrapper .profile-info h1 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-container .profile-content-wrapper .profile-info p {
    color: var(--text-secondary) !important;
}
/* =====================================
   HAMBURGER MENU FIX FOR DARK THEME
   Add this to the very bottom of style.css
   ===================================== */

/* Ensure hamburger button is visible and functional */
.hamburger {
    display: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-primary);
    transition: all 0.3s ease-in-out;
}

/* Dark theme hamburger colors */
[data-theme="dark"] .hamburger-bar {
    background-color: var(--text-primary) !important;
}

/* Mobile styles */
@media (max-width: 768px) {
    .hamburger {
        display: block !important;
        z-index: 1002 !important;
    }
    
    /* Navigation menu mobile styles */
    .navbar .nav-links {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 70% !important;
        height: 100vh !important;
        background-color: var(--nav-bg) !important;
        box-shadow: -5px 0 15px var(--shadow-color) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 6rem 2rem 2rem !important;
        transition: right 0.4s ease-in-out !important;
        z-index: 1001 !important;
    }

    /* When menu is active/open */
    .nav-links.is-active {
        right: 0 !important;
    }

    /* Mobile menu links */
    .navbar .nav-links li {
        margin: 0 !important;
        width: 100% !important;
    }

    .navbar .nav-links a {
        padding: 1.2rem 2rem 1.2rem 3rem !important;
        width: 100% !important;
        font-size: 1.2rem !important;
        border-bottom: 1px solid var(--border-primary) !important;
        color: var(--text-secondary) !important;
    }

    .navbar .nav-links a:hover,
    .navbar .nav-links a.active {
        color: var(--accent-primary) !important;
    }

    .navbar .nav-links .login-button {
        padding-top: 2rem !important;
    }

    /* Hamburger animation when active */
    .hamburger.is-active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.is-active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.is-active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Dark theme mobile menu */
    [data-theme="dark"] .navbar .nav-links {
        background-color: var(--nav-bg) !important;
        box-shadow: -5px 0 15px var(--shadow-color) !important;
    }
    
    [data-theme="dark"] .navbar .nav-links a {
        border-bottom: 1px solid var(--border-primary) !important;
        color: var(--text-secondary) !important;
    }
    
    [data-theme="dark"] .navbar .nav-links a:hover,
    [data-theme="dark"] .navbar .nav-links a.active {
        color: var(--accent-primary) !important;
    }

    /* Ensure theme toggle is visible in mobile */
    .theme-toggle {
        display: flex !important;
        margin-right: 0.5rem !important;
        z-index: 1002 !important;
    }
}

/* Fix any z-index conflicts */
.navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

/* Ensure proper stacking order */
[data-theme="dark"] .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
}

/* Fix mobile menu overlay issues */
@media (max-width: 768px) {
    body.menu-open {
        overflow: hidden;
    }
    
    /* Prevent profile page styles from interfering */
    [data-theme="dark"] .profile-container {
        z-index: 999 !important;
    }
    
    [data-theme="dark"] .modal {
        z-index: 1003 !important;
    }
}
/* =====================================
   SCHEDULE PAGES DARK THEME FIXES
   Add this to the very bottom of your style.css
   ===================================== */

/* Fix routine table for schedule-2021-22.html */
[data-theme="dark"] .routine-table-container {
    background: var(--card-bg) !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .routine-table {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    width: 100% !important;
}

[data-theme="dark"] .routine-table th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
    padding: 12px !important;
}

[data-theme="dark"] .routine-table td {
    background: var(--card-bg) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-primary) !important;
    padding: 10px !important;
}

[data-theme="dark"] .routine-table .day-row td {
    background: var(--accent-primary) !important;
    color: #FFFFFF !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* Fix batch page embedded styles - Term Selector */
[data-theme="dark"] .term-selector {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--card-bg) 100%) !important;
    border: 2px solid var(--border-primary) !important;
    box-shadow: 0 8px 30px var(--shadow-color) !important;
}

[data-theme="dark"] .term-btn {
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    border: 2px solid var(--border-primary) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 15px var(--shadow-color) !important;
}

[data-theme="dark"] .term-btn:hover {
    background: linear-gradient(145deg, var(--card-bg) 0%, rgba(211, 47, 47, 0.1) 100%) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3) !important;
}

[data-theme="dark"] .term-btn.active {
    background: linear-gradient(145deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
    border-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.4) !important;
}

[data-theme="dark"] .term-level,
[data-theme="dark"] .term-name {
    color: inherit !important;
}

/* Fix schedule display */
[data-theme="dark"] .schedule-display {
    background: var(--card-bg) !important;
    border: 2px solid var(--border-primary) !important;
    box-shadow: 0 10px 40px var(--shadow-color) !important;
}

[data-theme="dark"] .schedule-placeholder {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--card-bg) 100%) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .placeholder-content h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .placeholder-content p {
    color: var(--text-secondary) !important;
}

/* Fix schedule content */
[data-theme="dark"] .schedule-content {
    background: var(--card-bg) !important;
}

[data-theme="dark"] .schedule-header {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--border-primary) 100%) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .schedule-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .schedule-body {
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
}

/* Fix day schedule */
[data-theme="dark"] .day-schedule {
    background: var(--card-bg) !important;
    border: 2px solid var(--border-primary) !important;
    box-shadow: 0 10px 40px var(--shadow-color) !important;
}

[data-theme="dark"] .day-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-primary) 50%, var(--bg-secondary) 100%) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .day-classes {
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
}

[data-theme="dark"] .class-item {
    background: var(--card-bg) !important;
    border: 2px solid var(--border-primary) !important;
    box-shadow: 0 6px 20px var(--shadow-color) !important;
}

[data-theme="dark"] .class-item:hover {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.2) !important;
}

[data-theme="dark"] .class-time {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-primary) 50%, var(--bg-secondary) 100%) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .class-details {
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
}

[data-theme="dark"] .class-code {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--accent-primary) !important;
}

[data-theme="dark"] .class-teacher {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3) !important;
}

[data-theme="dark"] .class-room {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--border-primary) 50%, var(--bg-secondary) 100%) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 15px var(--shadow-color) !important;
}

[data-theme="dark"] .class-room.lab {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4) !important;
}

[data-theme="dark"] .class-room.online {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    color: var(--accent-primary) !important;
    border: 2px solid var(--accent-primary) !important;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.2) !important;
}

[data-theme="dark"] .no-classes {
    color: var(--text-secondary) !important;
}

/* Fix teachers info */
[data-theme="dark"] .teachers-info {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--card-bg) 100%) !important;
    border: 2px solid var(--border-primary) !important;
    box-shadow: 0 10px 40px var(--shadow-color) !important;
}

[data-theme="dark"] .teachers-info h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .teacher-card {
    background: linear-gradient(145deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    border: 2px solid var(--border-primary) !important;
}

[data-theme="dark"] .teacher-card:hover {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.15) !important;
}

[data-theme="dark"] .teacher-card strong {
    background: linear-gradient(145deg, var(--accent-primary) 0%, var(--accent-secondary) 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3) !important;
}

[data-theme="dark"] .teacher-card span {
    color: var(--text-primary) !important;
}

/* Fix accordion container */
[data-theme="dark"] .accordion-container {
    background: transparent !important;
}

[data-theme="dark"] .accordion {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .accordion:hover {
    background-color: var(--border-primary) !important;
}

[data-theme="dark"] .accordion.active {
    background-color: var(--accent-primary) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .schedule-placeholder {
    color: var(--text-secondary) !important;
}

/* Fix embedded iframe for Class Contents */
[data-theme="dark"] iframe {
    border: 2px solid var(--border-primary) !important;
    border-radius: 15px !important;
}

/* Fix any remaining white backgrounds */
[data-theme="dark"] .tab-content {
    background: transparent !important;
}

[data-theme="dark"] .tab-content h2 {
    color: var(--text-primary) !important;
}

/* Fix profile cards within the batch page */
[data-theme="dark"] .profile-card a {
    color: inherit !important;
    text-decoration: none !important;
}

[data-theme="dark"] .profile-card h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .profile-card p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .profile-card p strong {
    color: var(--text-primary) !important;
}

/* Fix any gradient overlays and animations */
[data-theme="dark"] .schedule-display::before {
    background: linear-gradient(90deg, var(--accent-primary), var(--text-primary), var(--bg-secondary), var(--accent-primary)) !important;
}

[data-theme="dark"] .day-header::after {
    background: linear-gradient(90deg, var(--accent-primary), var(--text-primary), var(--accent-primary)) !important;
}

/* Ensure text visibility in all states */
[data-theme="dark"] * {
    color: inherit;
}

/* Fix any remaining invisible text issues */
[data-theme="dark"] .term-btn *,
[data-theme="dark"] .class-item *,
[data-theme="dark"] .teacher-card *,
[data-theme="dark"] .day-schedule * {
    color: inherit !important;
}

/* Additional safety fixes */
[data-theme="dark"] .container {
    background: transparent !important;
}

[data-theme="dark"] body {
    background: var(--bg-primary) !important;
}

/* Fix any remaining table elements */
[data-theme="dark"] table {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] th {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] td {
    background: var(--card-bg) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-primary) !important;
}
/* Footer Styles */
.footer {
    background-color: #272727;
    color: #ecf0f1;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.footer-section h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #ffffff;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #34495e;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}
/* ======================================= */
/* ===== DROPDOWN NAVIGATION STYLES ====== */
/* ======================================= */

/* --- Base Styles for Dropdown --- */
.nav-item-has-children {
    position: relative;
}

.submenu-toggle {
    display: none; /* Hidden by default, shown on mobile */
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===================================
   DESKTOP STYLES (Hover Dropdown)
   =================================== */
@media (min-width: 769px) {
    .submenu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 220px;
        background-color: var(--nav-bg, #ffffff);
        border: 1px solid var(--border-primary, #DDDDDD);
        border-top: 2px solid var(--accent-primary, #A31F34);
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 25px var(--shadow-color, rgba(0, 0, 0, 0.1));
        padding: 0.5rem 0;
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, transform 0.3s ease;
        transform-origin: top center;
        transform: translateX(-50%) translateY(10px);
    }

    .nav-item-has-children:hover > .submenu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .submenu li a {
        display: block;
        padding: 0.75rem 1.5rem;
        color: var(--text-secondary, #555555);
        font-weight: 500;
        white-space: nowrap;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .submenu li a:hover {
        background-color: var(--bg-secondary, #F9F9F9);
        color: var(--accent-primary, #A31F34);
    }
}


/* ===================================================
   FINAL MOBILE DROPDOWN & ICON FIX
   =================================================== */
/* ===================================================
   MOBILE DROPDOWN ALIGNMENT FIX (CSS GRID METHOD)
   =================================================== */
@media (max-width: 768px) {
    /* 1. We define a two-column grid on the list item */
    .nav-item-has-children {
        display: grid;
        /* Column 1 takes all available space, Column 2 fits its content */
        grid-template-columns: 1fr auto; 
        align-items: center; /* Vertically aligns content in the row */
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }
    
    [data-theme="dark"] .nav-item-has-children {
        border-bottom-color: var(--border-primary);
    }

    /* 2. Place the main link in the first column */
    .nav-item-has-children > a {
        grid-column: 1;
        border-bottom: none !important;
    }

    /* 3. Place the toggle button in the second column */
    .submenu-toggle {
        grid-column: 2;
        display: block;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 1.2rem 2rem;
        font-size: 1.5rem;
        font-weight: 300;
        color: var(--text-secondary);
        line-height: 1;
        position: relative;
    }

    /* 4. This CSS adds the '+' icon */
    .submenu-toggle::before {
        content: '+';
        transition: transform 0.3s ease;
    }

    /* 5. This CSS changes the icon to a '−' when open */
    .nav-item-has-children.submenu-open > .submenu-toggle::before {
        content: '−'; /* This is a minus sign, not a hyphen */
    }

    /* 6. The dropdown list must span both columns on the next row */
    .submenu {
        grid-column: 1 / -1; /* This makes it span the full width */
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        background-color: var(--bg-secondary);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }

    .nav-item-has-children.submenu-open > .submenu {
        max-height: 500px;
    }

    /* Styles for links inside the dropdown */
    .submenu li a {
        padding: 0.8rem 2rem 0.8rem 3.5rem !important;
        font-size: 0.95rem !important;
        font-weight: 400 !important;
        color: var(--text-secondary) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }
    
    [data-theme="dark"] .submenu {
        background-color: var(--border-primary);
    }

    [data-theme="dark"] .submenu li a {
        border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    }

    .submenu li a.active,
    .submenu li a:hover {
        color: var(--accent-primary) !important;
        background: transparent !important;
    }
    
    .submenu li a::before {
        display: none;
    }
}
/* ===== CHATBOT STYLES ===== */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    left: 2rem; /* Changed from right to left */
    width: 4rem;
    height: 4rem;
    background-color: var(--mit-red);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: all 0.3s ease;
}
.chat-fab:hover {
    transform: scale(1.1);
    background-color: var(--accent-hover);
}

.chat-widget {
    position: fixed;
    bottom: 7rem;
    left: 2rem; /* Changed from right to left */
    width: 90%;
    max-width: 400px;
    height: 60vh;
    max-height: 500px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chat-widget.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: var(--mit-red);
    color: white;
    padding: 1rem;
    font-weight: bold;
    text-align: center;
}

.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
}

.chat-message.user {
    background-color: #e2e8f0;
    color: var(--text-black);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

[data-theme="dark"] .chat-message.user {
     background-color: #4a5568;
     color: var(--text-primary);
}

.chat-message.bot {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-input-area {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border-primary);
}

.chat-input-area input {
    flex-grow: 1;
    border: 1px solid var(--border-gray);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 20px;
    margin-right: 0.5rem;
}

.chat-input-area button {
    background: var(--mit-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-weight: bold;
}
/* =====================================
   FACULTY RESULTS PAGE - DARK THEME FIX
   ===================================== */

/* Fix for the "Enable Edit Mode" toggle bar */
[data-theme="dark"] .faculty-results-page .edit-mode-toggle {
    background-color: rgba(255, 193, 7, 0.1); /* Translucent yellow background */
    border-color: #ffc107;
}

[data-theme="dark"] .faculty-results-page .edit-mode-toggle label {
    color: #ffc107; /* Yellow text for better visibility */
}

/* Fix for the highlighted row during editing */
[data-theme="dark"] .faculty-results-page .results-table tr.edit-mode {
    background-color: rgba(255, 193, 7, 0.08); /* More subtle yellow for the row */
}

/* Fix for the invisible input and select fields */
[data-theme="dark"] .faculty-results-page .results-table td input,
[data-theme="dark"] .faculty-results-page .results-table td select {
    background-color: var(--bg-secondary); /* Dark background for inputs */
    color: var(--text-primary);            /* Light text for inputs */
    border-color: #ffc107;                 /* Keep yellow border to indicate editing */
}

/* Ensure placeholder text is visible if you ever add any */
[data-theme="dark"] .faculty-results-page .results-table td input::placeholder {
    color: var(--text-secondary);
}

/* Improve select dropdown appearance in dark mode */
[data-theme="dark"] .faculty-results-page .results-table td select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}