/* Custom animations and transitions for FiveBob Hygiene website */

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg) scale(0.95);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-15px);
    }
    70% {
        transform: translateY(-7px);
    }
    90% {
        transform: translateY(-2px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 3px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    }
}

/* Animation utility classes */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.4s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
}

.animate-on-scroll.fade-in-up {
    transform: translateY(15px);
}

.animate-on-scroll.fade-in-up.animate-in {
    transform: translateY(0);
}

.animate-on-scroll.fade-in-down {
    transform: translateY(-15px);
}

.animate-on-scroll.fade-in-down.animate-in {
    transform: translateY(0);
}

.animate-on-scroll.fade-in-left {
    transform: translateX(-15px);
}

.animate-on-scroll.fade-in-left.animate-in {
    transform: translateX(0);
}

.animate-on-scroll.fade-in-right {
    transform: translateX(15px);
}

.animate-on-scroll.fade-in-right.animate-in {
    transform: translateX(0);
}

.animate-on-scroll.scale-in {
    transform: scale(0.95);
}

.animate-on-scroll.scale-in.animate-in {
    transform: scale(1);
}

.animate-stagger {
    opacity: 0;
    transition: all 0.4s ease-out;
}

.animate-stagger.animate-in {
    opacity: 1;
}

.animate-load {
    opacity: 0;
}

.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* Hover transition classes */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: box-shadow 0.2s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

/* Card specific animations */
.card-hover {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Button animations */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-animate:hover::before {
    width: 200px;
    height: 200px;
}

.btn-animate:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

/* Image animations */
.img-hover {
    transition: transform 0.3s ease, filter 0.3s ease;
    overflow: hidden;
}

.img-hover:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.img-hover img {
    transition: transform 0.3s ease;
}

.img-hover:hover img {
    transform: scale(1.03);
}

/* Text animations */
.text-animate {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Progress bar animations */
.progress-animate {
    animation: progressGrow 1.5s ease-out;
}

@keyframes progressGrow {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-value);
    }
}

/* Notification animations */
.notification-slide {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal animations */
.modal-backdrop-animate {
    animation: fadeIn 0.3s ease-out;
}

.modal-content-animate {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateX(10px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.2s ease-out;
}

.page-transition-exit {
    opacity: 1;
    transform: translateX(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease-out;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}