:root {
    --background-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
    --card-background: #ffffff;
    --text-color: #2d3748;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --icon-size: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: var(--background-gradient);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    padding-top: 0; /* Ensure no top padding conflicts with fixed header */
    /* Prevent horizontal scroll when header is fixed */
    overflow-x: hidden;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #4285f4 0%, #1e3a8a 50%, #3b82f6 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* Ensure header stays fixed during scroll */
    will-change: transform;
    transform: translateZ(0); /* Hardware acceleration */
    margin-bottom: 120px; /* Updated margin-bottom to 120px */
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    padding: 0 30px;
    position: relative;
    z-index: 2;
}

/* Logo Section */
.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.header-logo {
    height: 50px;
    width: 50px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.school-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.school-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(45deg, #fff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.school-tagline {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-link i {
    font-size: 1rem;
    opacity: 0.9;
}

.nav-link span {
    font-size: 0.95rem;
}

/* Special styling for menu button to make it more prominent */
.nav-menu-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-menu-button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.15));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.nav-menu-button i {
    font-size: 1.1rem;
}

/* Student Profile Section */
.student-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 50px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.student-profile:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.student-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.student-class {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.student-avatar:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.profile-dropdown {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.student-profile:hover .profile-dropdown {
    transform: rotate(180deg);
    color: white;
}

/* Dark Mode Toggle */
.dark-mode-section {
    flex-shrink: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transition: 0.4s;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.sun-icon, .moon-icon {
    font-size: 0.8rem;
    z-index: 1;
    transition: all 0.3s ease;
}

.sun-icon {
    color: #fff;
}

.moon-icon {
    color: rgba(255, 255, 255, 0.5);
}

input:checked + .slider {
    background: linear-gradient(135deg, #1e293b, #334155);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

input:checked + .slider .sun-icon {
    color: rgba(255, 255, 255, 0.5);
}

input:checked + .slider .moon-icon {
    color: #fff;
}

/* Header Decorations */
.header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 100px;
    height: 100px;
    top: -50px;
    right: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 60px;
    height: 60px;
    top: 20px;
    right: 25%;
    animation-delay: 2s;
}

.circle-3 {
    width: 80px;
    height: 80px;
    top: -40px;
    left: 15%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Dark Mode Styles */
body.dark-mode {
    --background-gradient: linear-gradient(135deg, #1a1b1e 0%, #2d3748 50%, #1e293b 100%);
    --card-background: #1e1e1e;
    --text-color: #e0e0e0;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

body.dark-mode .header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-link {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .student-profile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .student-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .decoration-circle {
    background: rgba(255, 255, 255, 0.03);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-top: 132px; /* Add top margin to account for fixed header + 12px */
    /* Ensure content doesn't overlap with fixed header */
    position: relative;
    z-index: 1;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.page-title h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.page-title p {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

/* Modern Mobile Footer */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.25rem 1rem 1rem 1rem; /* Further reduced top padding */
    z-index: 1000;
    transition: all 0.3s ease;
}

body.dark-mode .mobile-footer {
    background: rgba(17, 24, 39, 0.95);
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.footer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 60px;
}

.footer-btn i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.footer-btn span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Home Button Special Styling */
.home-btn {
    margin-top: -30px;
}

.home-icon-wrapper {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    width: 56px;
    height: 56px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    position: relative;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
}

.home-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 32px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    z-index: -1;
    opacity: 0.5;
}

.home-btn i {
    font-size: 1.5rem;
    color: white;
}

/* Footer Button Hover/Active States */
.footer-btn:hover {
    color: #3b82f6;
    transform: translateY(-2px);
}

.footer-btn:active {
    transform: translateY(0);
}

.home-btn:hover .home-icon-wrapper {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
}

/* Dark Mode Styles */
body.dark-mode .footer-btn {
    color: #94a3b8;
}

body.dark-mode .footer-btn:hover {
    color: #60a5fa;
}

body.dark-mode .home-icon-wrapper {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Footer Decoration */
.footer-decoration {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 20px;
    overflow: hidden;
}

.decoration-wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%),
                linear-gradient(-45deg, transparent 33.33%, #fff 33.33%, #fff 66.66%, transparent 66.66%);
    background-size: 20px 40px;
    opacity: 0.1;
}

body.dark-mode .decoration-wave {
    background: linear-gradient(45deg, transparent 33.33%, #1e293b 33.33%, #1e293b 66.66%, transparent 66.66%),
                linear-gradient(-45deg, transparent 33.33%, #1e293b 33.33%, #1e293b 66.66%, transparent 66.66%);
}

/* Footer Copyright */
.footer-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 1rem;
    opacity: 0.8;
}

body.dark-mode .footer-copyright {
    color: #94a3b8;
}

/* Adjust main content for fixed footer */
.main-content {
    padding-bottom: 100px;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .footer-btn {
        min-width: 50px;
        padding: 6px;
    }

    .home-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .footer-btn span {
        font-size: 0.7rem;
    }
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #ffd700;
    font-weight: 600;
}

.footer-section p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section i {
    width: 20px;
    color: #ffd700;
}

.footer-link {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ffd700;
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #ffd700;
    color: #2c3e50;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}

.service-btn {
    background: var(--card-background);
    border: none;
    border-radius: var(--border-radius);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

/* Colorful icon backgrounds with gradients */
.service-btn:nth-child(1) i { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
.service-btn:nth-child(2) i { background: linear-gradient(135deg, #4FACFE, #00F2FE); }
.service-btn:nth-child(3) i { background: linear-gradient(135deg, #43E97B, #38F9D7); }
.service-btn:nth-child(4) i { background: linear-gradient(135deg, #FA709A, #FEE140); }
.service-btn:nth-child(5) i { background: linear-gradient(135deg, #6C5CE7, #A88BEB); }
.service-btn:nth-child(6) i { background: linear-gradient(135deg, #F6D365, #FDA085); }
.service-btn:nth-child(7) i { background: linear-gradient(135deg, #45B649, #DCE35B); }
.service-btn:nth-child(8) i { background: linear-gradient(135deg, #FF3CAC, #784BA0); }
.service-btn:nth-child(9) i { background: linear-gradient(135deg, #2AF598, #009EFD); }
.service-btn:nth-child(10) i { background: linear-gradient(135deg, #B721FF, #21D4FD); }
.service-btn:nth-child(11) i { background: linear-gradient(135deg, #3B41C5, #A8EB12); }
.service-btn:nth-child(12) i { background: linear-gradient(135deg, #fcb825, #c18607); }


.service-btn i {
    font-size: 1.8rem;
    color: white;
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.service-btn span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* Hover Effects */
.service-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
}

.service-btn:hover i {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
    color: black;
}

.service-btn:hover span {
    transform: scale(1.05);
}

/* Shimmer effect */
.service-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.service-btn:hover::after {
    animation: shimmer 1s forwards;
    opacity: 1;
}

@keyframes shimmer {
    0% {
        transform: rotate(45deg) translateX(-150%);
    }
    100% {
        transform: rotate(45deg) translateX(150%);
    }
}

/* Entry Animation */
.service-btn {
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
    transform: scale(0.5);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered Animation Delays */
.service-btn:nth-child(1) { animation-delay: 0.1s; }
.service-btn:nth-child(2) { animation-delay: 0.2s; }
.service-btn:nth-child(3) { animation-delay: 0.3s; }
.service-btn:nth-child(4) { animation-delay: 0.4s; }
.service-btn:nth-child(5) { animation-delay: 0.5s; }
.service-btn:nth-child(6) { animation-delay: 0.6s; }
.service-btn:nth-child(7) { animation-delay: 0.7s; }
.service-btn:nth-child(8) { animation-delay: 0.8s; }
.service-btn:nth-child(9) { animation-delay: 0.9s; }
.service-btn:nth-child(10) { animation-delay: 1.0s; }
.service-btn:nth-child(11) { animation-delay: 1.1s; }
.service-btn:nth-child(12) { animation-delay: 1.2s; }


/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 20px;
        gap: 20px;
    }
    
    .nav {
        gap: 5px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1.2rem 0; /* Changed to match 480px breakpoint height */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        /* Enhanced mobile fixed positioning */
        transform: translateZ(0);
        will-change: transform;
        margin-bottom: 16px; /* Ensure minimum 16px margin-bottom on tablet screens */
    }
    
    .main-content {
        margin-top: 112px; /* Adjust for mobile header height + 12px */
    }
    
    .header-content {
        flex-direction: row;
        gap: 8px; /* Reduced from 10px to 8px */
        padding: 0 8px; /* Reduced from 10px to 8px */
        flex-wrap: nowrap;
        overflow-x: auto;
        align-items: center;
        justify-content: space-between;
    }
    
    .logo-section {
        order: 1;
        flex-shrink: 0;
        gap: 8px; /* Reduced gap between logo and text */
    }
    
    .nav {
        order: 2;
        gap: 6px; /* Reduced from 8px to 6px */
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .student-profile {
        order: 3;
        gap: 6px; /* Reduced from 8px to 6px */
        padding: 4px 8px; /* Reduced padding */
        flex-shrink: 0;
    }
    
    .dark-mode-section {
        order: 4;
        flex-shrink: 0;
    }
    
    .school-name {
        font-size: 1.3rem; /* Reduced from 1.5rem */
    }
    
    .school-tagline {
        font-size: 0.75rem; /* Reduced from 0.8rem */
    }
    
    .header-logo {
        height: 35px; /* Reduced from 40px */
        width: 35px; /* Reduced from 40px */
    }
    
    .student-avatar {
        width: 32px; /* Reduced from 35px */
        height: 32px; /* Reduced from 35px */
    }
    
    .profile-info {
        display: flex !important; /* Keep profile info visible but smaller */
    }
    
    .student-name {
        font-size: 0.85rem; /* Reduced font size */
    }
    
    .student-class {
        font-size: 0.7rem; /* Reduced font size */
    }
    
    .switch {
        width: 50px; /* Reduced from 60px */
        height: 26px; /* Reduced from 30px */
    }
    
    .slider:before {
        height: 20px; /* Adjusted for smaller switch */
        width: 20px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(24px); /* Adjusted for smaller switch */
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .service-btn {
        padding: 15px 10px;
        min-height: 120px;
    }
    
    .service-btn i {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .service-btn span {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.2rem 0; /* Further reduced padding */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        /* Enhanced small mobile fixed positioning */
        transform: translateZ(0);
        will-change: transform;
        margin-bottom: 16px; /* Ensure minimum 16px margin-bottom on mobile screens */
    }
    
    .main-content {
        margin-top: 92px; /* Adjust for smaller mobile header height + 12px */
    }
    
    .header-content {
        gap: 4px; /* Further reduced gap */
        padding: 0 4px; /* Further reduced padding */
    }
    
    .logo-section {
        gap: 6px; /* Further reduced gap */
    }
    
    .school-name {
        font-size: 1.1rem; /* Further reduced from 1.3rem */
    }
    
    .school-tagline {
        font-size: 0.7rem; /* Further reduced */
    }
    
    .header-logo {
        height: 30px; /* Further reduced */
        width: 30px; /* Further reduced */
    }
    
    .nav {
        gap: 4px; /* Further reduced */
    }
    
    .nav-link {
        padding: 6px 10px; /* Reduced padding */
    }
    
    .student-profile {
        gap: 5px; /* Further reduced */
        padding: 3px 6px; /* Further reduced padding */
    }
    
    .student-avatar {
        width: 28px; /* Further reduced */
        height: 28px; /* Further reduced */
    }
    
    .student-name {
        font-size: 0.8rem; /* Further reduced */
    }
    
    .student-class {
        font-size: 0.65rem; /* Further reduced */
    }
    
    .switch {
        width: 45px; /* Further reduced */
        height: 24px; /* Further reduced */
    }
    
    .slider:before {
        height: 18px; /* Further reduced */
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(21px); /* Adjusted for smaller switch */
    }
    
    .sun-icon, .moon-icon {
        font-size: 0.7rem; /* Reduced icon size */
    }
    
    .services-grid {
        gap: 10px;
        padding: 10px;
    }
    
    .service-btn {
        padding: 12px 8px;
        min-height: 100px;
    }
    
    .service-btn i {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .service-btn span {
        font-size: 0.8rem;
    }
}

/* Accessibility */
.service-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5), var(--shadow);
}

.service-btn:focus:not(:focus-visible) {
    box-shadow: var(--shadow);
}

/* Subtle pulse animation for icons */
@keyframes subtlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.service-btn i {
    animation: subtlePulse 2s infinite;
}

.service-btn:hover i {
    animation: none;
}

/* Dark mode adjustments for glow and animation */
body.dark-mode .service-btn {
    box-shadow: none !important; /* Remove glow on button */
}

body.dark-mode .service-btn:hover {
    box-shadow: none !important; /* No glow on hover */
    background: linear-gradient(to bottom right, #000000, #222222) !important;
}

body.dark-mode .service-btn i {
    animation: none !important; /* Stop glowing animation by default */
    box-shadow: none !important; /* Remove glow */
}

body.dark-mode .service-btn:hover i {
    animation: none !important; /* Stop all glowing animation on hover */
    box-shadow: none !important; /* No glow on hover */
}

body.dark-mode .service-btn:hover {
    box-shadow: none !important; /* No glow on hover */
}

/* Override general hover animation stop in dark mode */
body.dark-mode .service-btn:hover i {
    animation-play-state: running !important;
}

/* Added to force display of profile-info on mobile screens */
@media (max-width: 768px) {
    .profile-info {
        display: flex !important;
    }
    
    /* Minimize Student Profile Section font sizes for small screens */
    .student-name {
        font-size: 0.75rem !important; /* Reduced from 0.85rem */
    }
    
    .student-class {
        font-size: 0.6rem !important; /* Reduced from 0.7rem */
    }
}

@media (max-width: 480px) {
    /* Further minimize for mobile screens */
    .student-name {
        font-size: 0.7rem !important; /* Further reduced */
    }
    
    .student-class {
        font-size: 0.55rem !important; /* Further reduced */
    }
    
    .student-profile {
        gap: 4px !important; /* Reduce gap between elements */
        padding: 2px 4px !important; /* Reduce padding */
    }
}

/* Styles for round buttons inside Grades modal */
.grades-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}



.round-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4caf50, #81c784);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
    transition: all 0.3s ease;
}

.round-btn:hover {
    background: linear-gradient(135deg, #388e3c, #66bb6a);
    box-shadow: 0 6px 16px rgba(56, 142, 60, 0.7);
    transform: scale(1.1);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-background);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #4285f4 0%, #1e3a8a 50%, #3b82f6 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
    position: relative;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
    z-index: 1;
    position: relative;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
}

.modal-body {
    padding: 32px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.grades-content {
    text-align: center;
}

.grades-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(246, 211, 101, 0.1), rgba(253, 160, 133, 0.1));
    border-radius: 16px;
    border: 2px solid rgba(246, 211, 101, 0.3);
    position: relative;
    overflow: hidden;
}

.grades-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(246, 211, 101, 0.1), transparent);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.grades-message i {
    font-size: 3rem;
    background: linear-gradient(135deg, #F6D365, #FDA085);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: bounce 2s infinite;
    z-index: 1;
    position: relative;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.grades-message h4 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    z-index: 1;
    position: relative;
}

.grades-message p {
    margin: 0;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.5;
    z-index: 1;
    position: relative;
}

/* Dark Mode Modal Styles */
body.dark-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .modal-content {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

body.dark-mode .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1e293b, #334155);
}

body.dark-mode .grades-message {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(51, 65, 85, 0.3));
    border: 2px solid rgba(100, 116, 139, 0.3);
}

body.dark-mode .grades-message::before {
    background: linear-gradient(45deg, transparent, rgba(100, 116, 139, 0.1), transparent);
}

body.dark-mode .grades-message p {
    color: #94a3b8;
}

/* Mobile Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 20px 20px 12px 20px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 24px 20px;
    }
    
    .grades-message {
        padding: 16px;
        gap: 12px;
    }
    
    .grades-message i {
        font-size: 2.5rem;
    }
    
    .grades-message h4 {
        font-size: 1.5rem;
    }
    
    .grades-message p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 16px 16px 10px 16px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 20px 16px;
    }
    
    .grades-message {
        padding: 12px;
        gap: 10px;
    }
    
    .grades-message i {
        font-size: 2rem;
    }
    
    .grades-message h4 {
        font-size: 1.3rem;
    }
    
    .grades-message p {
        font-size: 0.9rem;
    }
}

/* Modal Animation Enhancement */
.modal-overlay {
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

/* Modal2 Styles - Centered Screen Modal */
.modal2-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal2-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal2-content {
    background: var(--card-background);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1.5rem 2rem;
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal2-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.modal2-close {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.modal2-close:hover {
    color: #ff0000;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal2-content {
        width: 95%;
        max-height: 85vh;
        padding: 1rem 1.5rem;
    }

    .modal2-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .modal2-content {
        width: 95%;
        max-height: 90vh;
        padding: 0.75rem 1rem;
    }

    .modal2-title {
        font-size: 1rem;
    }
}

/* AgendaViewer Modal - New Modal for Student Agenda */
.agenda-viewer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(30,41,59,0.8));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.agenda-viewer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.agenda-viewer-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    width: 92%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.agenda-viewer-backdrop.show .agenda-viewer-container {
    transform: scale(1) translateY(0);
}

.agenda-viewer-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 1.8rem 2.2rem;
    position: relative;
    overflow: hidden;
}

.agenda-viewer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: headerShimmer 3s infinite;
}

@keyframes headerShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.agenda-viewer-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.agenda-viewer-close {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 2;
}

.agenda-viewer-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1) rotate(90deg);
}

.agenda-viewer-body {
    padding: 2.2rem;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.agenda-viewer-content {
    position: relative;
}

/* Dark mode support for AgendaViewer */
body.dark-mode .agenda-viewer-backdrop {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(15,23,42,0.9));
}

body.dark-mode .agenda-viewer-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body.dark-mode .agenda-viewer-header {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

body.dark-mode .agenda-viewer-body {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Responsive design for AgendaViewer */
@media (max-width: 768px) {
    .agenda-viewer-container {
        width: 96%;
        max-height: 90vh;
        border-radius: 20px;
    }
    
    .agenda-viewer-header {
        padding: 1.4rem 1.8rem;
    }
    
    .agenda-viewer-title {
        font-size: 1.2rem;
    }
    
    .agenda-viewer-close {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        top: 1rem;
        right: 1.2rem;
    }
    
    .agenda-viewer-body {
        padding: 1.8rem;
        max-height: calc(90vh - 100px);
    }
}

@media (max-width: 480px) {
    .agenda-viewer-container {
        width: 98%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .agenda-viewer-header {
        padding: 1.2rem 1.5rem;
    }
    
    .agenda-viewer-title {
        font-size: 1.1rem;
    }
    
    .agenda-viewer-close {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
        top: 0.8rem;
        right: 1rem;
    }
    
    .agenda-viewer-body {
        padding: 1.5rem;
        max-height: calc(95vh - 90px);
    }
}
