/**
 * CSS for Home Page Animations - Treatments Section Focus
 * Smooth, feel-good animations for treatments
 */
/* Smooth transitions for all animated elements */
[data-scroll-reveal] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-scroll-reveal].is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback: show elements after a delay if JS doesn't work */
@media (prefers-reduced-motion: no-preference) {
    [data-scroll-reveal] {
        animation: revealFallback 0.8s ease-out 2s both;
    }
}

@keyframes revealFallback {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.treatment-section,
.hair-treatment-section,
.treatment-carousel-div {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.treatment-section:hover,
.hair-treatment-section:hover,
.treatment-carousel-div:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 139, 34, 0.15);
}

/* Treatment images */
.treatment-section img,
.hair-treatment-section img,
.img-div img {
    transition: transform 0.5s ease, filter 0.5s ease;
    cursor: pointer;
}

.treatment-section img:hover,
.hair-treatment-section img:hover,
.img-div img:hover {
    transform: scale(1.08);
    filter: brightness(1.1) saturate(1.15);
}

/* Floating animation for side images */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.left-sdie-imgDiv {
    animation: float 3s ease-in-out infinite;
}

.right-sdie-imgDiv {
    animation: float 3.5s ease-in-out infinite 0.5s;
}


.treatment-section h5,
.hair-treatment-section h5,
.para-section p,
.treatment-section p {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gentlePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

.treatment-section:hover .img-div,
.hair-treatment-section:hover .img-div {
    animation: gentlePulse 2s ease-in-out infinite;
}


.treatment-section,
.hair-treatment-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.treatment-section.loaded,
.hair-treatment-section.loaded {
    opacity: 1 !important;
    transform: translateY(0) !important;
}


.treatment-section,
.hair-treatment-section {
    animation: forceRevealTreatment 1s ease-out 4s both;
}

@keyframes forceRevealTreatment {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}


.treatment-carousel-div {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.treatment-carousel-div.loaded {
    opacity: 1;
    transform: translateY(0);
}

.treatment-carousel-div {
    animation: forceRevealCarousel 1s ease-out 3s both;
}

@keyframes forceRevealCarousel {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}


.treatment-carousel-div.loaded,
.treatment-carousel-div[style*="opacity: 1"] {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Only apply initial hidden state if not loaded */
.treatment-carousel-div:not(.loaded):not([style*="opacity: 1"]) {
    opacity: 0;
    transform: translateY(30px);
}


.btn,
.nav-link {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover,
.nav-link:hover {
    transform: translateY(-2px);
}

/* Treatment grid animations */
.treatment-grid {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

.treatment-grid.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for treatment sections */
.treatment-section:nth-child(1) {
    transition-delay: 0.1s;
}

.treatment-section:nth-child(2) {
    transition-delay: 0.2s;
}

.treatment-section:nth-child(3) {
    transition-delay: 0.3s;
}

.hair-treatment-section {
    transition-delay: 0.4s;
}

/* Responsive animations */
@media (max-width: 768px) {

    .treatment-section,
    .hair-treatment-section,
    .treatment-carousel-div {
        transform: none;
        transition: opacity 0.6s ease;
    }

    .treatment-section:hover,
    .hair-treatment-section:hover,
    .treatment-carousel-div:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(34, 139, 34, 0.15);
    }
}

/* Pure CSS Animations without GSAP */
/* Fade In/Out Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Rotation Animations */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.8);
    }

    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Shake Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Wobble Animation */
@keyframes wobble {
    0% {
        transform: translateX(0%);
    }

    15% {
        transform: translateX(-25%) rotate(-5deg);
    }

    30% {
        transform: translateX(20%) rotate(3deg);
    }

    45% {
        transform: translateX(-15%) rotate(-3deg);
    }

    60% {
        transform: translateX(10%) rotate(2deg);
    }

    75% {
        transform: translateX(-5%) rotate(-1deg);
    }

    100% {
        transform: translateX(0%);
    }
}

/* Apply animations to elements - prevent repetition */
.animate-fadeIn {
    animation: fadeIn 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.8s ease-out;
    animation-fill-mode: forwards;
}

.animate-slideInDown {
    animation: slideInDown 0.8s ease-out;
    animation-fill-mode: forwards;
}

/* .animate-scaleIn {
    animation: scaleIn 0.6s ease-out;
    animation-fill-mode: forwards;
} */
.animate-rotateIn {
    animation: rotateIn 1s ease-out;
    animation-fill-mode: forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out;
    animation-fill-mode: forwards;
}

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
    animation-fill-mode: forwards;
}

.animate-wobble {
    animation: wobble 1s ease-in-out;
    animation-fill-mode: forwards;
}

/* Prevent multiple animations on same element */
.animated {
    animation-fill-mode: forwards !important;
}

/* Reset animation state for hover effects */
.animate-pulse:hover {
    animation: pulse 2s ease-in-out infinite;
}

/* Ensure elements stay visible after animation */
/* Counter section specific styles */
.counter-section {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem 0;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(34, 139, 34, 0.1), rgba(144, 238, 144, 0.1));
    border-radius: 15px;
    flex-wrap: wrap;
    gap: 1rem;
}

.counter-item {
    text-align: center;
    padding: 1rem;
    min-width: 120px;
}

.counter-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #228B22;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
    margin-bottom: 0.5rem;
    display: block;
}

.counter-number.animate {
    opacity: 1;
    transform: translateY(0);
    animation: countUp 1s ease-out;
}

.counter-item p {
    font-size: 1rem;
    color: #666;
    margin: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .counter-section {
        flex-direction: column;
        gap: 1.5rem;
    }

    .counter-number {
        font-size: 2rem;
    }
}

/* Staggered animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Accessibility - respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .treatment-section,
    .hair-treatment-section,
    .treatment-carousel-div,
    .treatment-section img,
    .hair-treatment-section img,
    .img-div img,
    .left-sdie-imgDiv,
    .right-sdie-imgDiv {
        animation: none;
        transition: opacity 0.3s ease;
    }

    .treatment-section:hover,
    .hair-treatment-section:hover,
    .treatment-carousel-div:hover {
        transform: none;
    }

    .animate-fadeIn,
    .animate-fadeInUp,
    .animate-fadeInDown,
    .animate-fadeInLeft,
    .animate-fadeInRight,
    .animate-slideInUp,
    .animate-slideInDown,
    .animate-scaleIn,
    .animate-rotateIn,
    .animate-bounceIn,
    .animate-pulse,
    .animate-shake,
    .animate-wobble {
        animation: none;
        opacity: 1;
        transform: none;
    }
}