/* Custom styles for Vista Del Sol Day Care Corp */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Scroll reveal animations - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal-left {
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal-right {
        opacity: 1;
        transform: translateX(0);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
}

/* Default visible state (no JS) */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
}

/* When JS adds hidden state */
.js .reveal-up {
    opacity: 0;
    transform: translateY(30px);
}

.js .reveal-left {
    opacity: 0;
    transform: translateX(-30px);
}

.js .reveal-right {
    opacity: 0;
    transform: translateX(30px);
}

/* Navbar scroll state */
.navbar-scrolled {
    background: rgba(255, 248, 246, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(140, 24, 50, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fff8f6;
}

::-webkit-scrollbar-thumb {
    background: #c9254a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a81a38;
}

/* Selection color */
::selection {
    background: #ffdbd1;
    color: #400a14;
}

/* Image lazy loading fade */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[data-src] {
    opacity: 0;
}

img[data-src].loaded {
    opacity: 1;
}

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

#mobile-menu.open {
    max-height: 500px;
    padding-top: 0;
}

/* Hero text animation - only if JS runs */
@media (prefers-reduced-motion: no-preference) {
    .js #hero h1 {
        animation: heroFadeIn 1s ease forwards;
    }
    
    .js #hero p {
        animation: heroFadeIn 1s ease 0.3s forwards;
        opacity: 0;
    }
    
    .js #hero .flex-col {
        animation: heroFadeIn 1s ease 0.5s forwards;
        opacity: 0;
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #c9254a;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
