/* Custom styles for Crabtree General Store and Coffee Vault */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f5f0dc;
}
::-webkit-scrollbar-thumb {
    background: #97c49b;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6ba36f;
}

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

@keyframes float-delay {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-2deg); }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delay {
    animation: float-delay 8s ease-in-out infinite;
}

/* Slide down animation for hero badge */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
}

/* Slide up animations for hero content */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-slide-up-delay {
    animation: slideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-slide-up-delay-2 {
    animation: slideUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* Reveal animations for scroll sections */
@keyframes revealLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.reveal-left {
    opacity: 0;
    animation: revealLeft 0.8s ease-out forwards;
}

.reveal-right {
    opacity: 0;
    animation: revealRight 0.8s ease-out forwards;
}

.reveal-up {
    opacity: 0;
    animation: revealUp 0.8s ease-out forwards;
}

/* Reduce motion preference */
@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;
    }
    
    .reveal-left,
    .reveal-right,
    .reveal-up {
        opacity: 1;
        animation: none;
    }
}

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

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

/* Mobile nav link transitions */
.mobile-nav-link {
    position: relative;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #6ba36f;
    transition: width 0.3s ease;
}

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

/* Navbar scroll state */
nav.scrolled {
    background: rgba(253, 252, 248, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(45, 82, 48, 0.1);
}

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

nav.scrolled .nav-link:hover {
    color: #6ba36f !important;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #97c49b;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Selection color */
::selection {
    background: #c5dfc8;
    color: #1f3621;
}
