/* Custom Styles for O'Brien's Garden Center */

/* Base Reset & Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection Color */
::selection {
    background-color: rgba(45, 110, 51, 0.3);
    color: #1a4d2e;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8fc791;
}

/* Animation Keyframes */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

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

@keyframes scroll-line {
    0% {
        height: 0;
        opacity: 0;
    }
    50% {
        height: 48px;
        opacity: 1;
    }
    100% {
        height: 48px;
        opacity: 0;
    }
}

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

/* Animation Classes */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 5s ease-in-out infinite;
    animation-delay: 1s;
}

.animate-scroll-line {
    animation: scroll-line 2s ease-in-out infinite;
}

/* Reveal Animation - Progressive Enhancement */
/* Content is visible by default; JS adds the animated state */
.reveal {
    /* Default: fully visible, no animation */
    opacity: 1;
    transform: translateY(0);
    transition: none;
}

/* When JS is enabled and prefers-reduced-motion is respected */
@media (prefers-reduced-motion: no-preference) {
    .reveal.animated {
        animation: fadeInUp 0.8s ease-out forwards;
    }
    
    .reveal:nth-child(2).animated { animation-delay: 0.1s; }
    .reveal:nth-child(3).animated { animation-delay: 0.2s; }
    .reveal:nth-child(4).animated { animation-delay: 0.3s; }
    .reveal:nth-child(5).animated { animation-delay: 0.4s; }
    .reveal:nth-child(6).animated { animation-delay: 0.5s; }
}

/* Navbar Scroll State */
.navbar-scrolled {
    background: rgba(12, 35, 20, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

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

/* Focus Styles for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #8fc791;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print Styles */
@media print {
    nav, #backToTop, .animate-float, .animate-float-delayed {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .bg-emerald-900, .bg-emerald-950 {
        background: #1a4d2e !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

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

/* High Contrast Mode */
@media (forced-colors: active) {
    .bg-emerald-800, .bg-emerald-900, .bg-emerald-950 {
        background-color: ButtonText;
    }
    
    .text-emerald-100, .text-emerald-200, .text-emerald-300 {
        color: ButtonText;
    }
}

/* Utility: Hide scrollbar for mobile menu */
.no-scroll {
    overflow: hidden;
}
