/* Custom styles for The Little Barn Farm */

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

/* Base styles */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navbar scroll effect */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-scrolled .nav-link {
    color: #2d2d42 !important;
}

.nav-scrolled .logo-text {
    color: #1a1a2e !important;
}

.nav-scrolled .mobile-menu-btn span {
    background: #2d2d42 !important;
}

/* Mobile menu active state */
.mobile-menu-open #mobile-menu {
    transform: translateX(0) !important;
}

/* Mobile menu lines animation */
.mobile-menu-open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-open .menu-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-open .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.4rem;
}

/* Scroll reveal animations */
.reveal-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Hero entrance animations - visible by default for progressive enhancement */
@keyframes fadeInUp {
    from {
        opacity: 1;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 1;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animations only when JS is available via .animated class */
.animated [style*="animation-delay"] {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animated [style*="animation-delay: 0.15s"] {
    animation: fadeInUp 0.8s ease-out 0.15s forwards;
    opacity: 0;
}

.animated [style*="animation-delay: 0.3s"] {
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.animated [style*="animation-delay: 0.45s"] {
    animation: fadeInUp 0.8s ease-out 0.45s forwards;
    opacity: 0;
}

.animated [style*="animation-delay: 0.6s"] {
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.animated [style*="animation-delay: 0.3s"].animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

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

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

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

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

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

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

/* Button ripple effect */
button, a {
    position: relative;
    overflow: visible;
}

/* Selection color */
::selection {
    background: #F97066;
    color: white;
}

/* Image loading placeholder */
img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

img[src] {
    animation: none;
    background: none;
}

/* Mobile menu link hover */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #F97066;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mobile-link:hover::after {
    width: 80%;
}

/* Card hover effects */
.group:hover .group-hover\\:scale-110 {
    transform: scale(1.1);
}

/* Floating animation helper */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(3deg);
    }
}

/* Spin animation helper */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation helper */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Bounce animation helper */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}
