/* Custom styles for The Home Care Agency FLA */

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

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

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

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

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

/* Selection color */
::selection {
    background: rgba(247, 96, 42, 0.3);
    color: #f6f6f6;
}

/* Base transitions */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image loading optimization */
img {
    loading: lazy;
}

/* Prevent layout shift on images */
img {
    display: block;
    max-width: 100%;
}

/* Custom focus styles */
*:focus-visible {
    outline: 2px solid #f7602a;
    outline-offset: 2px;
}

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

/* Scroll reveal animations (progressive enhancement) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger children animations */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }

/* Hero text animation on load */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > * {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }
.hero-content > *:nth-child(5) { animation-delay: 0.5s; }

/* Floating card animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating-card {
    animation: float 4s ease-in-out infinite;
}

/* Pulse animation for CTA */
@keyframes pulse-soft {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(247, 96, 42, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(247, 96, 42, 0);
    }
}

.cta-pulse {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #f7602a 0%, #ffad82 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile menu transitions */
#mobileMenu {
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#mobileMenu.open {
    opacity: 1;
    visibility: visible;
}

#mobileMenu.closed {
    opacity: 0;
    visibility: hidden;
}

/* Navbar glass effect */
#navbar.scrolled {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Card hover effects */
.group:hover .group-hover\:translate-y-[-4px] {
    transform: translateY(-4px);
}

/* Form input autofill styling */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1a1a1a inset !important;
    -webkit-text-fill-color: #f6f6f6 !important;
}

/* Print styles */
@media print {
    nav, #contact, footer, .cta-pulse {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .bg-coral-500 {
        background-color: LinkText;
    }
    
    .text-coral-400 {
        color: LinkText;
    }
}

/* Landscape mobile optimization */
@media (max-width: 640px) and (orientation: landscape) {
    #hero {
        min-height: auto;
        padding: 6rem 0;
    }
    
    #hero img {
        height: 300px;
    }
}
