/* 
 * A Pleasure To Walk - Dog Walking Business Website
 * Animations and Transitions
 */

/* ===== Fade In Animation ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Different delays for staggered animations */
.fade-in-delay-1 {
    transition-delay: 0.2s;
}

.fade-in-delay-2 {
    transition-delay: 0.4s;
}

.fade-in-delay-3 {
    transition-delay: 0.6s;
}

/* ===== Slide In Animations ===== */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible,
.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Scale Animation ===== */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ===== Rotate Animation ===== */
.rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ===== Bounce Animation ===== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.bounce.visible {
    animation-name: bounce;
}

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

.pulse {
    animation-duration: 1.5s;
    animation-fill-mode: both;
    animation-iteration-count: infinite;
}

.pulse.visible {
    animation-name: pulse;
}

/* ===== Shake Animation ===== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation-duration: 0.8s;
    animation-fill-mode: both;
}

.shake.visible {
    animation-name: shake;
}

/* ===== Page Transition ===== */
.page-transition {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-exit {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter {
    opacity: 0;
    transform: translateY(-20px);
}

.page-enter-active,
.page-exit-active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Button Hover Effects ===== */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-hover-effect:hover:after {
    left: 100%;
}

/* ===== Image Hover Effects ===== */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* ===== Card Hover Effects ===== */
.card-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Loading Animation ===== */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Success Animation ===== */
@keyframes checkmark {
    0% {
        height: 0;
        width: 0;
        opacity: 0;
    }
    40% {
        height: 0;
        width: 10px;
        opacity: 1;
    }
    100% {
        height: 20px;
        width: 10px;
        opacity: 1;
    }
}

.success-checkmark {
    width: 30px;
    height: 30px;
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.success-checkmark:before {
    content: '';
    position: absolute;
    border-right: 3px solid var(--success-color);
    border-bottom: 3px solid var(--success-color);
    width: 0;
    height: 0;
    bottom: 6px;
    left: 6px;
    transform: rotate(45deg);
    transform-origin: 0% 100%;
    animation: checkmark 0.3s ease 0.2s forwards;
}
