/* =====================================================
   ZEM CLOUD - Apple-Inspired Animations
   Subtle, elegant, and performant
   ===================================================== */

/* =====================================================
   Page Load Animations
   ===================================================== */

.animate-fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out forwards;
}

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

.animate-fade-up.delay-1 { animation-delay: 0.1s; }
.animate-fade-up.delay-2 { animation-delay: 0.2s; }
.animate-fade-up.delay-3 { animation-delay: 0.3s; }
.animate-fade-up.delay-4 { animation-delay: 0.4s; }

.animate-scale-in {
    opacity: 0;
    transform: scale(0.95);
    animation: scaleIn 0.8s ease-out forwards;
}

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

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

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* =====================================================
   Interactive Hover States
   ===================================================== */

/* Button Hover Effects */
.btn {
    transition: all 200ms ease-in-out;
}

.btn-primary {
    transition: opacity 200ms ease-in-out, transform 150ms ease-in-out;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-secondary {
    transition: background-color 200ms ease-in-out, opacity 200ms ease-in-out;
}

.btn-secondary:hover {
    opacity: 0.95;
}

.btn-link {
    transition: opacity 200ms ease-in-out;
}

.btn-link:hover {
    opacity: 0.7;
}

/* Card Hover Effects */
.feature-card,
.pricing-card {
    transition: transform 300ms ease-in-out, opacity 200ms ease-in-out;
}

.feature-card:hover {
    transform: translateY(-8px);
    opacity: 1;
}

.pricing-card:hover {
    transform: translateY(-8px);
    opacity: 1;
}

/* Link Hover Animation */
a:hover {
    opacity: 0.8;
    transition: opacity 200ms ease-in-out;
}

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

.stat-card {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
}

.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: fadeUp 0.6s ease-out 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
   ===================================================== */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

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

@keyframes orbit {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.orbit {
    animation: orbit 20s linear infinite;
}

.orbit-2 {
    animation-direction: reverse;
    animation-duration: 25s;
}

.orbit-3 {
    animation-duration: 30s;
}

@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);
    }
}

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

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

.mobile-nav {
    transform: translateX(100%);
    transition: transform 300ms ease-in-out;
}

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

.menu-toggle span {
    transition: all 300ms ease-in-out;
}

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

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

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

/* =====================================================
   Header Animations
   ===================================================== */

.header {
    transition: all 200ms ease-in-out;
}

.header.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-link {
    transition: opacity 200ms ease-in-out;
}

.nav-link:hover {
    opacity: 1;
}

.theme-toggle {
    transition: all 200ms ease-in-out;
}

.theme-toggle:hover {
    opacity: 1;
}

/* =====================================================
   Loading States
   ===================================================== */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

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

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

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

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

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

.form-input {
    transition: border-color 200ms ease-in-out, box-shadow 200ms ease-in-out;
}

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

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

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease-in-out;
}

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

.accordion-icon {
    transition: transform 300ms ease-in-out;
}

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

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

.tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: opacity 200ms ease-in-out, transform 200ms ease-in-out, visibility 200ms ease-in-out;
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    visibility: visible;
    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; }

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

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

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 400ms ease-in-out, transform 400ms ease-in-out;
}

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

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 300ms ease-in-out;
}

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

@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;
    }

    .feature-card:hover,
    .pricing-card:hover {
        transform: none;
    }
}
