:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --text: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --bg: #f7fafc;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --header-height: 60px;
    --mobile-nav-height: 60px;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    :root {
        --header-height: 80px;
    }
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    -webkit-overflow-scrolling: touch;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: pan-y;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', sans-serif;
    color: #2d3748;
    font-weight: 700;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
        padding-top: 0;
        font-size: 16px;
    }
}









.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 0 0 env(safe-area-inset-bottom);
    z-index: 1000;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    contain: layout style paint;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    padding: 10px 8px 8px;
    transition: all 0.25s var(--transition-smooth);
    position: relative;
    flex: 1;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 60px;
    touch-action: manipulation;
}

.mobile-nav .nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    z-index: 1;
}

.mobile-nav .nav-item i {
    font-size: 24px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-nav .nav-item span {
    font-weight: 400;
    line-height: 1.2;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 0 0 3px 3px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav .nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.mobile-nav .nav-item.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.mobile-nav .nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.mobile-nav .nav-item.active::after {
    transform: translate(-50%, -50%) scale(1);
}

.mobile-nav .nav-item.active i {
    transform: scale(1.1);
    color: var(--primary) !important;
}

.mobile-nav .nav-item.active span {
    transform: translateY(-1px);
    color: var(--primary) !important;
}

.mobile-nav .nav-item:active {
    transform: scale(0.92);
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    overscroll-behavior: contain;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.lightbox-close {
    top: 15px;
    right: 15px;
}

.lightbox-prev {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

@media (min-width: 768px) {

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }

    .lightbox-close {
        top: 30px;
        right: 30px;
    }

    .lightbox-prev {
        left: 30px;
    }

    .lightbox-next {
        right: 30px;
    }
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--gradient);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}



/* Improve touch targets for mobile */
@media (max-width: 767px) {

    .nav-item,
    .class-btn,
    .student-card,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {

    .stat-card,
    .feature-item,
    .hero-animation,
    .swing-img {
        animation: none !important;
        transition: none !important;
    }
}

/* Optimize for very small screens */
@media (max-width: 360px) {
    .header-container {
        padding: 0.5rem 0.75rem;
    }

    .logo h2 {
        font-size: clamp(0.85rem, 3vw, 1rem);
    }

    .mobile-nav {
        padding: 0.4rem 0.25rem;
        min-height: 60px;
    }

    .mobile-nav .nav-item {
        font-size: clamp(0.65rem, 2vw, 0.75rem);
        padding: 0.3rem 0.2rem;
    }

    .mobile-nav .nav-item i {
        font-size: clamp(1rem, 4vw, 1.2rem);
    }

    .footer {
        font-size: clamp(0.7rem, 2vw, 0.85rem);
        padding: 0.6rem;
    }
}

/* Performance optimizations */
.header,
.mobile-nav,
.lightbox {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Smooth scrolling optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection only in input fields */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift */
lottie-player {
    aspect-ratio: 1;
}