/* Custom styles for Relax Hair and Beauty Salon */

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal animations - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

/* When JS is enabled, add initial hidden state for reveal elements below fold */
.js-enabled .reveal {
    opacity: 0;
    transform: translateY(30px);
}

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

/* Fallback: ensure content is visible even without JS */
.reveal {
    opacity: 1;
    transform: none;
}

/* Navbar transitions */
.nav-scrolled {
    background: rgba(5, 46, 22, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav-scrolled .font-serif,
.nav-scrolled .font-sans {
    color: #fefdf8 !important;
}

/* Mobile menu animation */
#mobile-menu {
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

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

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

/* Service card hover effects */
.group:hover .group-hover\:bg-emerald-200 {
    transform: scale(1.05);
}

/* Image hover effects */
.overflow-hidden {
    overflow: hidden;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #15803d;
}

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

/* Selection color */
::selection {
    background: #166534;
    color: #fefdf8;
}

/* Subtle gradient overlay for gallery images */
.overflow-hidden::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 46, 22, 0.1) 0%, transparent 40%);
    pointer-events: none;
    border-radius: inherit;
    z-index: 1;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Prevent layout shift on images */
img {
    content-visibility: auto;
}

/* Hero decorative animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.absolute.top-40.right-20 {
    animation: float 6s ease-in-out infinite;
}

.absolute.bottom-40.left-20 {
    animation: float 8s ease-in-out infinite reverse;
}

/* Testimonial card hover */
.bg-white.rounded-2xl.p-8 {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bg-white.rounded-2xl.p-8:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(22, 101, 52, 0.12) !important;
}

/* CTA section image parallax feel */
@media (prefers-reduced-motion: no-preference) {
    #contact ~ section img,
    section:has(#contact) img {
        transition: transform 0.5s ease;
    }
}

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

/* Print styles */
@media print {
    nav, #mobile-menu-btn, .reveal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
