/* ===== Custom Styles for Zoila Hair Salon ===== */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f0f7f0;
}
::-webkit-scrollbar-thumb {
    background: #8cc58c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5aaa5a;
}

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

.floating-card:nth-child(2) {
    animation-delay: -1.3s;
    animation-duration: 5s;
}

.floating-card:nth-child(3) {
    animation-delay: -2.6s;
    animation-duration: 4.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

/* Service card hover effect */
.service-card {
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s ease, background-color 0.5s ease;
}

.service-card:hover {
    transform: translateY(-6px);
}

/* Navbar styles */
.nav-link {
    position: relative;
}

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

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

/* Mobile nav links */
.mobile-nav-link {
    transform: translateX(0);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Scroll reveal animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Staggered delays for grid items */
    .service-card:nth-child(1) { transition-delay: 0.05s; }
    .service-card:nth-child(2) { transition-delay: 0.1s; }
    .service-card:nth-child(3) { transition-delay: 0.15s; }
    .service-card:nth-child(4) { transition-delay: 0.2s; }
    .service-card:nth-child(5) { transition-delay: 0.25s; }
    .service-card:nth-child(6) { transition-delay: 0.3s; }
}

/* Gallery hover */
.gallery-item {
    overflow: hidden;
    border-radius: 1rem;
}

.gallery-item img {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Testimonial cards */
.testimonial-card {
    transition: transform 0.4s ease, background-color 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* Input focus effects */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(45, 122, 45, 0.15);
}

/* Back to top button */
#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#backToTop:not(.visible) {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hero image subtle pulse */
@keyframes subtle-pulse {
    0%, 100% { box-shadow: 0 25px 50px -12px rgba(22, 101, 52, 0.25); }
    50% { box-shadow: 0 30px 60px -12px rgba(22, 101, 52, 0.35); }
}

#hero > div > div:last-child > div {
    animation: subtle-pulse 4s ease-in-out infinite;
}

/* Active nav link highlight */
.nav-link.active {
    color: #166534;
}

.nav-link.active::after {
    width: 60%;
}

/* Mobile menu transition */
#mobileMenu {
    animation: slideDown 0.3s ease forwards;
}

#mobileMenu.hidden {
    animation: slideUp 0.2s ease forwards;
}

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

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

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