/* =====================================================
   ZEM CLOUD - Animations Stylesheet
   Smooth, Apple-inspired animations
   ===================================================== */

/* =====================================================
   Base Animation Classes
   ===================================================== */

/* Fade Up Animation */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

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

/* Scale In Animation */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.95);
    animation: scaleIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade In Animation */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Slide In From Left */
.animate-slide-left {
    opacity: 0;
    transform: translateX(-40px);
    animation: slideLeft 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

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

/* Slide In From Right */
.animate-slide-right {
    opacity: 0;
    transform: translateX(40px);
    animation: slideRight 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

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

/* =====================================================
   Animation Delays
   ===================================================== */

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* =====================================================
   Scroll-Triggered Animations
   ===================================================== */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children animations */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* =====================================================
   Interactive Animations
   ===================================================== */

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Card Hover Effects */
.feature-card,
.pricing-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
                border-color 0.4s ease;
}

/* Link Arrow Animation */
.btn-link svg {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-link:hover svg {
    transform: translateX(6px);
}

/* =====================================================
   Loading Animations
   ===================================================== */

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-5%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* =====================================================
   Dashboard Preview Animations
   ===================================================== */

.stat-card {
    animation: fadeUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.5s; }
.stat-card:nth-child(2) { animation-delay: 0.6s; }
.stat-card:nth-child(3) { animation-delay: 0.7s; }

.endpoint-row {
    animation: slideLeft 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    opacity: 0;
}

.endpoint-row:nth-child(1) { animation-delay: 0.8s; }
.endpoint-row:nth-child(2) { animation-delay: 0.9s; }
.endpoint-row:nth-child(3) { animation-delay: 1s; }

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* =====================================================
   Security Graphic Animations
   ===================================================== */

.shield-icon {
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 113, 227, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 113, 227, 0.6);
    }
}

/* =====================================================
   Page Transition Animations
   ===================================================== */

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

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* =====================================================
   Number Counter Animation
   ===================================================== */

.count-up {
    display: inline-block;
}

/* =====================================================
   Floating Animation
   ===================================================== */

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

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* =====================================================
   Gradient Text Animation
   ===================================================== */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text-animated {
    background: linear-gradient(
        90deg,
        #0071e3 0%,
        #5856d6 25%,
        #af52de 50%,
        #5856d6 75%,
        #0071e3 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* =====================================================
   Notification Badge Animation
   ===================================================== */

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.badge-animate {
    animation: badge-pop 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* =====================================================
   Mobile Menu Animations
   ===================================================== */

.mobile-nav {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.mobile-nav.active {
    transform: translateX(0);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* =====================================================
   Form Input Animations
   ===================================================== */

.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.form-label {
    transition: transform 0.3s ease, color 0.3s ease, font-size 0.3s ease;
}

/* =====================================================
   Accordion Animations
   ===================================================== */

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

/* =====================================================
   Tooltip Animations
   ===================================================== */

.tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =====================================================
   Scroll Progress Animation
   ===================================================== */

.scroll-progress {
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* =====================================================
   Reduced Motion
   ===================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
