/* Ensure sidebar menu slides in smoothly */
#mobile-menu {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden initially */
    width: 75%; /* Adjust width */
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    padding: 2rem;
    max-width: 100vw;
}

/* When active, slide in */
#mobile-menu.active {
    transform: translateX(-100%);
}

/* Ensure menu links align properly */
#mobile-menu nav a {
    display: block;
    text-align: left;
    font-size: 18px;
    padding: 10px 0;
}

/* Style Enroll Button inside Sidebar */
#mobile-menu .btn-hover {
    display: block;
    text-align: center;
    width: 100%;
    padding: 12px;
    background: #ff4081; /* Pink color */
    color: white;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 18px;
}

/* Ensure desktop navigation is hidden on mobile */
@media (max-width: 767px) {
    .desktop-nav {
        display: none;
    }

    /* Move mobile menu button to the right */
    .mobile-menu-button {
        position: absolute;
        right: 15px;
        top: 20px;
        font-size: 24px;
        background: none;
        border: none;
        cursor: pointer;
    }

    /* Ensure sidebar stays on top */
    nav {
        position: relative;
        z-index: 500;
    }
}

/* Fix horizontal overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Ensure containers don't overflow */
.container {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Fix image responsive behavior */
img {
    max-width: 100%;
    height: auto;
}

/* Adjust grid layouts for mobile */
@media (max-width: 768px) {
    .grid {
        margin-left: 0;
        margin-right: 0;
    }
    
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* Fix padding and margins on mobile */
@media (max-width: 768px) {
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Fix HAPPY curriculum container */
.happy-container {
    width: auto;
    max-width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
    box-sizing: border-box;
}

/* Fix mobile menu positioning */
#mobile-menu {
    max-width: 100vw;
    width: 75%;
}

/* Fix any overflowing flex items */
.flex {
    flex-wrap: wrap;
}

/* Ensure testimonials don't overflow */
.testimonial-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix gallery images */
.gallery-image {
    width: 100%;
    object-fit: cover;
}

/* Fix contact form container */
.form-container {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

/* hero section */
/* Animation Keyframes */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes wave {
    0% { transform: translateY(0); }
    25% { transform: translateY(-5px); }
    75% { transform: translateY(5px); }
    100% { transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation Classes */
.spin-animation {
    animation: spin 10s linear infinite;
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.bounce-animation {
    animation: bounce 2s ease-in-out infinite;
}

.wave-animation {
    animation: wave 2s ease-in-out infinite;
}

.text-reveal {
    opacity: 0;
    animation: textReveal 1s ease-out forwards;
}

/* Button Hover Effects */
.btn-hover {
    transition: transform 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.modal-open {
    overflow: hidden;
}

/* Form Input Styles */
input:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

/* Custom Scrollbar for Modal */
.modal-scroll {
    scrollbar-width: thin;
    scrollbar-color: #EC4899 #FDF2F8;
}

.modal-scroll::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: #FDF2F8;
    border-radius: 4px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #EC4899;
    border-radius: 4px;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .text-reveal {
        text-align: center;
    }
    
    .btn-hover {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Adjust form inputs for better mobile touch */
    input, textarea, button {
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }

    #schedule-modal .bg-white {
        margin: 1rem auto;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Improve touch scrolling */
    #schedule-modal form {
        -webkit-overflow-scrolling: touch;
    }
}

/* Hero section mobile adjustments */
@media (max-width: 768px) {
    .hero-section .text-reveal {
        text-align: left;
    }
    
    .hero-section .btn-hover {
        width: auto;
        margin: 0;
    }
    
    .hero-section .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Form Element Animations */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: scale(1.02);
}

/* Decorative Elements */
.decorative-star {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
}

/* Loading Animation for Image */
.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .spin-animation,
    .float-animation,
    .bounce-animation,
    .wave-animation {
        animation: none;
    }
}

/* Modal Mobile Fixes */
#schedule-modal {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Fix extra space below hero */
.min-h-screen {
    min-height: 100vh;
    margin-bottom: 0;
}

/* Ensure content after hero doesn't get extra space */
section + section {
    margin-top: 0;
}

/* Lazy Load Images */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* HAPPY Curriculum Section */
.happy-container {
    position: relative;
    min-height: 400px;
    background: linear-gradient(180deg, #fff5f7 0%, #fff 100%);
    border-radius: 2rem;
    overflow: hidden;
    padding: 3rem 1rem;
    border: 8px solid #ffd1dc;
    box-shadow: 0 0 30px rgba(255, 182, 193, 0.3);
    margin: 2rem auto;
    max-width: 1200px;
    width: auto;
    max-width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
    box-sizing: border-box;
}

.happy-title {
    font-size: 2rem;
    text-align: center;
    color: #ff6b88;
    margin-bottom: 2rem;
    font-weight: 800;
    text-shadow: 2px 2px 0 #ffe6ea;
    position: relative;
}

.happy-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 8px;
    background: repeating-linear-gradient(45deg, #ff6b88, #ff6b88 10px, #ffd1dc 10px, #ffd1dc 20px);
    border-radius: 4px;
}

.letter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 2rem 0;
    position: relative;
}

.hanging-letter {
    position: relative;
    cursor: pointer;
    transform-origin: top center;
    transition: transform 0.5s;
    margin: 0 0.5rem;
}

.string {
    width: 3px;
    height: 40px;
    background: repeating-linear-gradient(0deg, #ffd1dc, #ffd1dc 5px, transparent 5px, transparent 10px);
    margin: 0 auto 10px;
    transform-origin: top center;
}

.letter {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    background: white;
    box-shadow: 0 8px 16px rgba(255, 182, 193, 0.3);
    border: 4px solid;
    transition: all 0.3s ease;
    position: relative;
}

.letter::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
}

.letter-h { border-color: #ff6b88; color: #ff6b88; }
.letter-a { border-color: #ffb347; color: #ffb347; }
.letter-p1 { border-color: #98d8aa; color: #98d8aa; }
.letter-p2 { border-color: #7bb2ff; color: #7bb2ff; }
.letter-y { border-color: #da70d6; color: #da70d6; }

.meaning-box {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    width: 150px;
    padding: 1rem;
    border-radius: 1rem;
    background: white;
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 10px 20px rgba(255, 182, 193, 0.2);
    border: 3px solid;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 10;
}

.cat-animation {
    position: absolute;
    width: 150px;
    height: 150px;
    opacity: 0.9;
    pointer-events: none;
}

.cat-right {
    right: 2rem;
    bottom: 2rem;
}

.cat-left {
    left: 2rem;
    bottom: 2rem;
}

@media (max-width: 768px) {
    .letter-container {
        gap: 0.5rem;
    }

    .letter {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .string {
        height: 30px;
    }

    .meaning-box {
        width: 120px;
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .cat-animation {
        width: 100px;
        height: 100px;
    }
    
    .cat-right {
        right: 1rem;
        bottom: 1rem;
    }
    
    .cat-left {
        left: 1rem;
        bottom: 1rem;
    }
}

@keyframes swing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.hanging-letter:hover {
    animation: swing 1s ease-in-out;
}

.hanging-letter:hover .meaning-box {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    top: 130%;
}

/* Floating hearts animation */
.heart {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatHeart 4s ease-in-out infinite;
    opacity: 0;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100%) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Additional Hero Background Animations */
.hero-bg-element {
    position: absolute;
    pointer-events: none;
    opacity: 0.5;
}

.floating-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffd1dc, #ffb6c1);
    animation: floatAround 15s linear infinite;
}

.floating-star {
    font-size: 24px;
    color: #ff69b4;
    animation: twinkle 3s ease-in-out infinite;
}

.floating-cloud {
    width: 60px;
    height: 30px;
    background: #fff5f7;
    border-radius: 20px;
    animation: driftAcross 20s linear infinite;
}

@keyframes floatAround {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(100px, -50px) rotate(180deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes driftAcross {
    from { transform: translateX(-100%); }
    to { transform: translateX(calc(100vw + 100%)); }
}

/* Adjust spacing between hero and features section */
.hero-section {
    margin-bottom: 1rem; /* Reduce bottom margin */
}

.features-section {
    padding-top: 1rem; /* Reduce top padding */
}

/* Mobile responsiveness for background elements */
@media (max-width: 768px) {
    .hero-bg-element {
        transform: scale(0.7);
    }
}

/* Add to existing CSS */
.responsive-img {
    max-width: 100%;
    height: auto;
    aspect-ratio: attr(width) / attr(height);
}

@media (max-width: 768px) {
    .team-card img {
        width: 100px;
        height: 100px;
    }
}

/* Improve loading performance */
@media (prefers-reduced-motion: no-preference) {
    .lazy-load {
        opacity: 0;
        transition: opacity 0.5s ease-in;
    }
    
    .lazy-load.loaded {
        opacity: 1;
    }
}

/* Floating Animals */
.floating-animal {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    width: 40px;
    height: 40px;
    animation: floatAround 15s linear infinite;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.floating-animal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes floatAround {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, 50px) rotate(10deg);
    }
    50% {
        transform: translate(0, 100px) rotate(-10deg);
    }
    75% {
        transform: translate(-100px, 50px) rotate(10deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Hide animals on mobile for better performance */
@media (max-width: 768px) {
    .floating-animal {
        display: none;
    }
}

/* Schedule Modal Styles */
#schedule-modal .form-group {
    position: relative;
    transition: transform 0.3s ease;
}

#schedule-modal .form-group:hover {
    transform: translateX(5px);
}

#schedule-modal input:focus,
#schedule-modal textarea:focus {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    transform: scale(1.01);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#schedule-modal img[alt="Bird"] {
    animation: float 3s ease-in-out infinite;
}

#schedule-modal img[alt="Butterfly"] {
    transition: transform 0.3s ease;
}

#schedule-modal button:hover img[alt="Butterfly"] {
    transform: translateY(-50%) scale(1.2);
}

/* Hide side animals on mobile */
@media (max-width: 768px) {
    #schedule-modal img[alt="Rabbit"],
    #schedule-modal img[alt="Bear"],
    #schedule-modal img[alt="Fox"],
    #schedule-modal img[alt="Penguin"],
    #schedule-modal img[alt="Owl"] {
        display: none;
    }
}

/* Schedule Modal Close Button Styles */
#schedule-modal .close-button {
    position: absolute;
    right: -15px;
    top: -15px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1100;
    transition: all 0.3s ease;
    background: white;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#schedule-modal .close-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

#schedule-modal .close-button:hover img {
    transform: rotate(10deg) scale(1.1);
}

/* Ensure close button stays visible on mobile */
@media (max-width: 768px) {
    #schedule-modal .close-button {
        right: 10px;
        top: 10px;
    }
}

