/* PERFORMANCE OPTIMIZATION: Force GPU Acceleration */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Use translate3d to force hardware acceleration */
@keyframes float {
    0%, 100% { transform: translateY(0px) translateZ(0); }
    50% { transform: translateY(-10px) translateZ(0); }
}
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50% { transform: translateY(-15px) translateZ(0); }
}
@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg) translateZ(0); }
    50% { transform: rotate(3deg) translateZ(0); }
}
@keyframes hop {
    0%, 100% { transform: translateY(0) scale(1) translateZ(0); }
    25% { transform: translateY(-8px) scale(1.05) translateZ(0); }
    75% { transform: translateY(-4px) scale(1.02) translateZ(0); }
}
/* Optimized color pulse to avoid filter repaint if possible, sticking to opacity/transform where applicable, but keeping filter for UI fidelity */
@keyframes colorPulse {
    0%, 100% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.2) saturate(1.3); }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.5; transform: scale(0.9) translateZ(0); }
    50% { opacity: 1; transform: scale(1.1) translateZ(0); }
}
@keyframes slideInFromLeft {
    0% { transform: translateX(-100px) translateZ(0); opacity: 0; }
    100% { transform: translateX(0) translateZ(0); opacity: 1; }
}
@keyframes slideInFromRight {
    0% { transform: translateX(100px) translateZ(0); opacity: 0; }
    100% { transform: translateX(0) translateZ(0); opacity: 1; }
}
@keyframes pop {
    0% { transform: scale(0.5) translateZ(0); opacity: 0; }
    100% { transform: scale(1) translateZ(0); opacity: 1; }
}
@keyframes rainbowGlow {
    0% { box-shadow: 0 0 20px #ff6b9d; }
    25% { box-shadow: 0 0 25px #ffd166; }
    50% { box-shadow: 0 0 20px #06d6a0; }
    75% { box-shadow: 0 0 25px #118ab2; }
    100% { box-shadow: 0 0 20px #ef476f; }
}
@keyframes ping {
    75%, 100% { transform: scale(2); opacity: 0; }
}

/* Cartoon animations */
@keyframes cartoonFloat {
    0%, 100% { transform: translateY(0) translateZ(0) rotate(0deg); }
    25% { transform: translateY(-20px) translateZ(0) rotate(5deg); }
    50% { transform: translateY(-10px) translateZ(0) rotate(-5deg); }
    75% { transform: translateY(-15px) translateZ(0) rotate(3deg); }
}

@keyframes cartoonBounce {
    0%, 100% { transform: translateY(0) translateZ(0) scale(1); }
    50% { transform: translateY(-25px) translateZ(0) scale(1.1); }
}

@keyframes cartoonSlide {
    0% { transform: translateX(-100px) translateZ(0) scale(0.8); opacity: 0; }
    100% { transform: translateX(0) translateZ(0) scale(1); opacity: 1; }
}

@keyframes cartoonSpin {
    0% { transform: rotate(0deg) translateZ(0); }
    100% { transform: rotate(360deg) translateZ(0); }
}

/* Add will-change to hint browser for heavy animations */
.animate-float { animation: float 3s ease-in-out infinite; will-change: transform; }
.animate-bounce-slow { animation: bounce-slow 2s ease-in-out infinite; will-change: transform; }
.animate-wiggle { animation: wiggle 2s ease-in-out infinite; will-change: transform; }
.animate-hop { animation: hop 1.5s ease-in-out infinite; will-change: transform; }
.animate-color-pulse { animation: colorPulse 3s ease-in-out infinite; }
.animate-twinkle { animation: twinkle 2s ease-in-out infinite; will-change: opacity, transform; }
.animate-slide-left { animation: slideInFromLeft 0.8s ease-out; will-change: transform, opacity; }
.animate-slide-right { animation: slideInFromRight 0.8s ease-out; will-change: transform, opacity; }
.animate-pop { animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); will-change: transform, opacity; }
.animate-rainbow { animation: rainbowGlow 4s linear infinite; } /* Box-shadow is expensive, removed will-change to avoid memory hog on mobile for shadows */
.animate-ping { animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-cartoon-float { animation: cartoonFloat 4s ease-in-out infinite; will-change: transform; }
.animate-cartoon-bounce { animation: cartoonBounce 3s ease-in-out infinite; will-change: transform; }
.animate-cartoon-slide { animation: cartoonSlide 1.5s ease-out; will-change: transform, opacity; }
.animate-cartoon-spin { animation: cartoonSpin 8s linear infinite; will-change: transform; }

::selection { 
    background-color: #ffd166; 
    color: #073b4c;
}

/* Bright Theme Custom Colors */
.text-dark-custom { color: #073b4c; }
.text-purple-custom { color: #7209b7; }
.border-peach-custom { border-color: #ff9e6d; }
.border-lavender-custom { border-color: #a663cc; }
.border-sky-custom { border-color: #4cc9f0; }
.border-purple-custom { border-color: #7209b7; }

/* Bright Glassmorphism Utilities */
/* Optimization: Use transform: translateZ(0) to put glass panels on their own layer */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateZ(0); 
}
.glass-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transform: translateZ(0);
}

/* Gallery Card Styles */
.gallery-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 16px -1px rgba(0, 0, 0, 0.1), 0 4px 8px -1px rgba(0, 0, 0, 0.06);
    transform: translateZ(0);
}
.gallery-card:hover {
    transform: translateY(-10px) scale(1.05) translateZ(0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

/* Floating Bubbles */
.floating-bubble {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff006e, #ffbe0b);
    opacity: 0.8;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 0, 110, 0.3));
    will-change: transform; /* Optimization */
}

/* Button Press Effect */
.btn-press:active {
    transform: scale(0.95) translateZ(0);
    transition: transform 0.1s;
}

/* Cartoon Characters */
.cartoon-character {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: transform, opacity;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.cartoon-character.visible {
    opacity: 0.9;
}

.cartoon-character:hover {
    opacity: 1 !important;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    transform: scale(1.1) translateZ(0);
    transition: all 0.3s ease;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-float { animation: float 4s ease-in-out infinite; }
    .animate-bounce-slow { animation: bounce-slow 5s ease-in-out infinite; }
    .cartoon-character {
        transform: scale(0.7);
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(45deg, #ff006e, #ffbe0b, #3a86ff, #8338ec);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 300% 300%;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Bright Neon Glow */
.neon-glow {
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.5),
                0 0 40px rgba(255, 0, 110, 0.3),
                0 0 60px rgba(255, 0, 110, 0.1);
}

/* WhatsApp Button Styles - RESPONSIVE FIX */
#whatsapp-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 10000;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transform: translateZ(0); /* Optimization */
}
#whatsapp-button a {
    display: block;
    width: 60px;
    height: 60px;
    position: relative;
}
#whatsapp-button a img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.3s ease;
    background: #25d366;
    padding: 12px;
    box-sizing: border-box;
}
#whatsapp-button a:hover img {
    transform: scale(1.1) translateZ(0);
}
#whatsapp-button a:active img {
    transform: scale(0.95) translateZ(0);
}

/* Responsive adjustments for WhatsApp button */
@media (max-width: 768px) {
    #whatsapp-button {
        bottom: 20px;
        right: 20px;
    }
    #whatsapp-button a {
        width: 56px;
        height: 56px;
    }
    #whatsapp-button a img {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #whatsapp-button {
        bottom: 15px;
        right: 15px;
    }
    #whatsapp-button a {
        width: 52px;
        height: 52px;
    }
    #whatsapp-button a img {
        padding: 8px;
    }
}

@media (max-width: 320px) {
    #whatsapp-button {
        bottom: 10px;
        right: 10px;
    }
    #whatsapp-button a {
        width: 48px;
        height: 48px;
    }
}

/* PERFORMANCE: Content Visibility 
   This property prevents off-screen content from rendering until scrolled to.
   Drastically reduces initial load lag on phones.
*/
#legacy, #faculty, #celebrations, #tuition {
    content-visibility: auto;
    contain-intrinsic-size: 1px 800px; /* Approximate height of sections */
}

/* Logo styling */
.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1) rotate(5deg);
}