/**
 * Advanced Animations Library
 * Parallax, 3D effects, micro-interactions, scroll animations
 * @package TechBeta_Redesign
 */

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

@keyframes rotateBorder {
    from {
        border-image-source: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #667eea);
    }
    to {
        border-image-source: linear-gradient(225deg, #667eea, #764ba2, #f093fb, #667eea);
    }
}

/* ============================================
   SCROLL TRIGGERED ANIMATIONS
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stagger-item-animate {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================
   3D CARD EFFECTS
   ============================================ */

[data-tilt-3d] {
    transition: transform 0.4s ease-out;
    transform-style: preserve-3d;
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */

[data-parallax] {
    transition: transform 0.1s ease-out;
}

/* ============================================
   MAGNETIC BUTTONS
   ============================================ */

[data-magnetic] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

[data-magnetic]::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;
}

[data-magnetic]:hover::before {
    left: 100%;
}

/* ============================================
   RIPPLE EFFECTS
   ============================================ */

[data-ripple] {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

/* ============================================
   LOADING SKELETON
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
}

.skeleton.shimmer-active {
    animation: shimmer 1.5s infinite;
}

/* ============================================
   GRADIENT TEXT
   ============================================ */

.gradient-text-animate {
    background: linear-gradient(
        135deg,
        #667eea,
        #764ba2,
        #f093fb
    );
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
}

/* ============================================
   GLASSMORPHISM
   ============================================ */

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ============================================
   ADVANCED SHADOW SYSTEM
   ============================================ */

.shadow-sm {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.05),
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.1),
        0 32px 64px rgba(0, 0, 0, 0.12);
}

.shadow-colored {
    box-shadow:
        0 10px 30px rgba(102, 126, 234, 0.2),
        0 20px 60px rgba(102, 126, 234, 0.15);
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.card-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.card-hover-scale {
    transition: all 0.3s ease;
}

.card-hover-scale:hover {
    transform: scale(1.05);
}

/* ============================================
   FLOATING ANIMATION
   ============================================ */

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

/* ============================================
   PULSE ANIMATION
   ============================================ */

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

/* ============================================
   GLOW EFFECT
   ============================================ */

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

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .animate-on-scroll {
        animation-duration: 0.6s;
    }

    [data-tilt-3d] {
        transform: none !important;
    }
}
