/* ===== KEYFRAME ANIMATIONS ===== */

/* 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.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Bounce animations */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-3px);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-5px);
    }
    40%, 80% {
        transform: translateX(5px);
    }
}

/* Rotation animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Gradient animations */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes colorShift {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(180deg);
    }
}

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

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

/* Glow effects */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.6);
    }
}

/* Typing animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: var(--primary-color);
    }
}

/* Slide animations */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== ANIMATION UTILITY CLASSES ===== */

/* Basic animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
    opacity: 0;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
    opacity: 0;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease forwards;
    opacity: 0;
}

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

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-rotate {
    animation: rotate 2s linear infinite;
}

.animate-rotate-in {
    animation: rotateIn 0.8s ease forwards;
    opacity: 0;
}

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

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

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

/* Delayed animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}

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

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

/* Duration variations */
.animate-slow {
    animation-duration: 2s;
}

.animate-fast {
    animation-duration: 0.5s;
}

/* ===== HERO SPECIFIC ANIMATIONS ===== */
.hero-title {
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.6s both;
}

/* ===== NAVBAR ANIMATIONS ===== */
.navbar {
    animation: slideInFromTop 0.8s ease both;
}

.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.nav-link:hover::after {
    left: 0;
}

/* ===== CARD HOVER ANIMATIONS ===== */
.service-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

.feature-item {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02), rgba(59, 130, 246, 0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-item:hover::before {
    opacity: 1;
}

/* ===== BUTTON ANIMATIONS ===== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

.btn:active {
    transform: translateY(1px);
}

/* Loading button animation */
.btn-loading .fas {
    animation: rotate 1s linear infinite;
}

/* ===== FORM ANIMATIONS ===== */
.form-control {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.form-control:focus {
    transform: translateY(-2px);
}

.contact-form {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.contact-info-section {
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* ===== PRICING CARD ANIMATIONS ===== */
.pricing-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pricing-card:hover {
    transform: translateY(-15px) scale(1.02);
}

.pricing-card.featured {
    animation: pulse 2s infinite;
}

.pricing-card.featured:hover {
    animation: none;
}

/* ===== TABLE ANIMATIONS ===== */
.comparison-table tr {
    transition: all 0.3s ease;
}

.comparison-table tr:hover {
    transform: scale(1.01);
}

/* ===== STATS COUNTER ANIMATIONS ===== */
.stat-number {
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
    color: var(--secondary-color);
}

/* ===== FAQ ANIMATIONS ===== */
.faq-question {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.faq-answer {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateX(5px);
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* ===== THEME TOGGLE ANIMATIONS ===== */
.theme-toggle {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.theme-toggle:active {
    transform: rotate(180deg) scale(0.9);
}

/* ===== SOCIAL ICON ANIMATIONS ===== */
.social-icon {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.social-icon:hover::before {
    left: 100%;
}

.social-icon:hover {
    transform: translateY(-3px) rotate(5deg);
}

/* ===== LOADING STATES ===== */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ===== PARTICLE EFFECTS ===== */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particle-float 20s linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* ===== RESPONSIVE ANIMATION ADJUSTMENTS ===== */
@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;
    }
}

@media (max-width: 768px) {
    .hero-title {
        animation: fadeInUp 0.8s ease 0.1s both;
    }
    
    .hero-subtitle {
        animation: fadeInUp 0.8s ease 0.2s both;
    }
    
    .hero-buttons {
        animation: fadeInUp 0.8s ease 0.3s both;
    }
    
    .service-card:hover {
        transform: translateY(-5px);
    }
    
    .feature-item:hover {
        transform: translateY(-3px);
    }
    
    .pricing-card:hover {
        transform: translateY(-5px);
    }
    
    .btn:hover {
        transform: translateY(-1px);
    }
}

/* ===== INTERSECTION OBSERVER ANIMATIONS ===== */
.fade-in-observer {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.slide-in-left-observer {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slide-in-left-observer.observed {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right-observer {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slide-in-right-observer.observed {
    opacity: 1;
    transform: translateX(0);
}

.scale-in-observer {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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