/* ========================================
   CRONUSOFT - Animations & Transitions
   ======================================== */

/* ========================================
   Fade In Animations
   ======================================== */

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

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

/* ========================================
   Scale Animations
   ======================================== */

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

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

/* ========================================
   Glow Animations
   ======================================== */

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

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

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

@keyframes countUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   Hero Animations
   ======================================== */

.hero-title {
    animation: fadeInDown 0.8s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* ========================================
   Button Animations
   ======================================== */

.btn {
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    left: 100%;
}

/* ========================================
   Service Card Animations
   ======================================== */

.service-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.service-card:nth-child(1) { animation-delay: 0s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.2s; }
.service-card:nth-child(4) { animation-delay: 0.3s; }
.service-card:nth-child(5) { animation-delay: 0.4s; }
.service-card:nth-child(6) { animation-delay: 0.5s; }

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: width 0.5s ease;
}

.service-card:hover::after {
    width: 100%;
}

/* ========================================
   Portfolio Animations
   ======================================== */

.portfolio-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }

.portfolio-image {
    position: relative;
    overflow: hidden;
}

.portfolio-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 92, 246, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-image::after {
    opacity: 1;
}

.portfolio-image img {
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1);
}

/* ========================================
   Process Step Animations
   ======================================== */

.step {
    animation: fadeInUp 0.6s ease-out backwards;
}

.step:nth-child(1) { animation-delay: 0s; }
.step:nth-child(3) { animation-delay: 0.1s; }
.step:nth-child(5) { animation-delay: 0.2s; }
.step:nth-child(7) { animation-delay: 0.3s; }

.step-number {
    transition: all 0.3s ease;
}

.step:hover .step-number {
    transform: scale(1.1) rotate(360deg);
}

/* ========================================
   Pricing Card Animations
   ======================================== */

.pricing-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

.pricing-card:nth-child(1) { animation-delay: 0s; }
.pricing-card:nth-child(2) { animation-delay: 0.1s; }
.pricing-card:nth-child(3) { animation-delay: 0.2s; }

.pricing-card.featured {
    animation: fadeInUp 0.6s ease-out 0.1s both, pulse 2s ease-in-out 1s infinite;
}

.pricing-features li {
    animation: fadeInLeft 0.4s ease-out backwards;
}

.pricing-features li:nth-child(1) { animation-delay: 0.1s; }
.pricing-features li:nth-child(2) { animation-delay: 0.15s; }
.pricing-features li:nth-child(3) { animation-delay: 0.2s; }
.pricing-features li:nth-child(4) { animation-delay: 0.25s; }
.pricing-features li:nth-child(5) { animation-delay: 0.3s; }

/* ========================================
   Feature Card Animations
   ======================================== */

.feature {
    animation: fadeInUp 0.6s ease-out backwards;
}

.feature:nth-child(1) { animation-delay: 0s; }
.feature:nth-child(2) { animation-delay: 0.1s; }
.feature:nth-child(3) { animation-delay: 0.2s; }

.feature-icon {
    display: inline-block;
    transition: all 0.3s ease;
}

.feature:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
    animation: pulse 0.6s ease-out;
}

/* ========================================
   Scroll Reveal Animation
   ======================================== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Navigation Animation
   ======================================== */

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transition: width var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* ========================================
   Mobile Menu Animation
   ======================================== */

.nav-menu.active {
    animation: slideInLeft 0.3s ease-out;
}

.hamburger span {
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translateY(12px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* ========================================
   Theme Toggle Animation
   ======================================== */

.theme-toggle {
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

/* ========================================
   Chat Widget Animation
   ======================================== */

.chat-widget {
    animation: fadeInUp 0.3s ease-out;
}

.chat-widget.active {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message {
    animation: fadeInUp 0.3s ease-out;
}

.chat-toggle {
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    animation: pulse 0.6s ease-out;
}

/* ========================================
   Loading Animation
   ======================================== */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* ========================================
   Hover Lift Effect
   ======================================== */

@keyframes lift {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

.lift:hover {
    animation: lift 0.6s ease-in-out;
}

/* ========================================
   Smooth Scroll Behavior
   ======================================== */

html {
    scroll-behavior: smooth;
}

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

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-right-color: transparent;
    }
}

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

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

.gradient-text {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    background-size: 200% auto;
    animation: gradientFlow 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Form Animation
   ======================================== */

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    animation: scaleIn 0.2s ease-out;
}

/* ========================================
   CTA Section Animation
   ======================================== */

.cta-title {
    animation: fadeInDown 0.8s ease-out;
}

.cta-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.cta .btn {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ========================================
   Footer Animation
   ======================================== */

.footer-section {
    animation: fadeInUp 0.6s ease-out backwards;
}

.footer-section:nth-child(1) { animation-delay: 0s; }
.footer-section:nth-child(2) { animation-delay: 0.1s; }
.footer-section:nth-child(3) { animation-delay: 0.2s; }
.footer-section:nth-child(4) { animation-delay: 0.3s; }

/* ========================================
   Stagger Animation
   ======================================== */

.stagger > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.3s; }
.stagger > *:nth-child(5) { animation-delay: 0.4s; }
.stagger > *:nth-child(6) { animation-delay: 0.5s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.6s; }

/* ========================================
   Smooth Transitions
   ======================================== */

* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button, a, input, select, textarea {
    transition: all 0.3s ease;
}
