/* Custom styles for One World Children's Rehab */

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

/* Scroll reveal base — content is visible by default (no JS required) */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only apply animation when JS is enabled and motion is preferred */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero orbs animation */
@media (prefers-reduced-motion: no-preference) {
    .hero-orb {
        animation: float 8s ease-in-out infinite;
    }
    
    .orb-1 {
        animation-delay: 0s;
    }
    
    .orb-2 {
        animation-delay: -3s;
    }
    
    .orb-3 {
        animation-delay: -5s;
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -20px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(59, 7, 100, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Mobile menu animation */
#mobileMenu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Active nav link indicator */
.nav-link.active {
    color: #fbbf24;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #9333ea;
}

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

/* Selection color */
::selection {
    background: #c084fc;
    color: #3b0764;
}

/* Image aspect ratios */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent layout shift on images */
img[width][height] {
    object-fit: cover;
}

/* Button hover lift effect */
button, a {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* 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;
    }
}

/* Print styles */
@media print {
    nav, #contactForm, button, .hero-orb {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}

/* Tablet and up adjustments */
@media (min-width: 768px) {
    .scroll-reveal {
        transition-delay: 0.1s;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .scroll-reveal {
        transition-delay: 0.15s;
    }
}
