/* ===========================================
   PREMIUM ANIMATIONS - SINSAJO CREATORS
   World-class animations for a world-class agency
   =========================================== */

/* ===========================================
   ANIMATION KEYFRAMES
   =========================================== */

/* Fade In Up - Elegant entrance from below */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down - Entrance from above */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left - Entrance from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right - Entrance from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In - Zoom entrance */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scale In Bounce - Playful zoom entrance */
@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float - Gentle floating motion */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse Glow - Soft pulsing glow effect */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
    }
}

/* Gradient Flow - Moving gradient background */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer - Premium shine effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Rotate In - Spinning entrance */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Slide In Blur - Modern blur entrance */
@keyframes slideInBlur {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Typewriter Cursor - For text animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Bounce In - Energetic entrance */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    20% {
        transform: scale(1.1);
    }
    40% {
        transform: scale(0.9);
    }
    60% {
        opacity: 1;
        transform: scale(1.03);
    }
    80% {
        transform: scale(0.97);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shake - Attention grabber */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Wiggle - Playful motion */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(3deg); }
    75% { transform: rotate(-3deg); }
}

/* Heartbeat - Emotional pulse */
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* Border Glow - Premium border animation */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(139, 92, 246, 0.5);
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    }
    50% {
        border-color: rgba(139, 92, 246, 1);
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
    }
}

/* Ripple - Click feedback */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Text Gradient Animation */
@keyframes textGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Parallax Float */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(1deg);
    }
    75% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* ===========================================
   UTILITY CLASSES - Apply to any element
   =========================================== */

/* Animate on scroll trigger classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
    opacity: 1;
}

/* Fade animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
}

.animate-fade-up.is-visible {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-down {
    opacity: 0;
    transform: translateY(-40px);
}

.animate-fade-down.is-visible {
    animation: fadeInDown 0.8s ease forwards;
}

.animate-fade-left {
    opacity: 0;
    transform: translateX(-40px);
}

.animate-fade-left.is-visible {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-right {
    opacity: 0;
    transform: translateX(40px);
}

.animate-fade-right.is-visible {
    animation: fadeInRight 0.8s ease forwards;
}

/* Scale animations */
.animate-scale {
    opacity: 0;
    transform: scale(0.9);
}

.animate-scale.is-visible {
    animation: scaleIn 0.6s ease forwards;
}

.animate-scale-bounce {
    opacity: 0;
    transform: scale(0.3);
}

.animate-scale-bounce.is-visible {
    animation: scaleInBounce 0.8s ease forwards;
}

/* Blur entrance */
.animate-blur {
    opacity: 0;
    filter: blur(10px);
}

.animate-blur.is-visible {
    animation: slideInBlur 0.8s ease forwards;
}

/* Staggered animations - use with data-delay attribute */
.animate-stagger {
    opacity: 0;
    transform: translateY(30px);
}

.animate-stagger.is-visible {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-stagger[data-delay="1"] { animation-delay: 0.1s; }
.animate-stagger[data-delay="2"] { animation-delay: 0.2s; }
.animate-stagger[data-delay="3"] { animation-delay: 0.3s; }
.animate-stagger[data-delay="4"] { animation-delay: 0.4s; }
.animate-stagger[data-delay="5"] { animation-delay: 0.5s; }
.animate-stagger[data-delay="6"] { animation-delay: 0.6s; }

/* ===========================================
   CONTINUOUS ANIMATIONS
   =========================================== */

/* Floating effect for images/cards */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Pulsing glow for buttons/CTAs */
.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Gradient background animation */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradientFlow 5s ease infinite;
}

/* Shimmer effect for premium elements */
.animate-shimmer {
    position: relative;
    overflow: hidden;
}

.animate-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    pointer-events: none;
}

/* Border glow effect */
.animate-border-glow {
    animation: borderGlow 2s ease-in-out infinite;
}

/* Heartbeat for important elements */
.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Wiggle for attention */
.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

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

/* ===========================================
   HOVER ANIMATIONS
   =========================================== */

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Hover scale */
.hover-scale {
    transition: transform 0.3s ease;
}

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

/* Hover glow */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

/* Hover shine */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::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;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Hover rotate */
.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Hover underline animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* ===========================================
   BUTTON ANIMATIONS
   =========================================== */

/* Premium button with ripple */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: ripple 0.6s ease-out;
}

/* CTA button with gradient animation */
.btn-cta-animated {
    background: linear-gradient(270deg, #8b5cf6, #6366f1, #8b5cf6);
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-cta-animated:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

/* ===========================================
   TEXT ANIMATIONS
   =========================================== */

/* Animated gradient text */
.text-gradient-animated {
    background: linear-gradient(270deg, #8b5cf6, #ec4899, #6366f1, #8b5cf6);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 5s ease infinite;
}

/* Typing cursor */
.text-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

/* ===========================================
   CARD ANIMATIONS
   =========================================== */

/* Premium card hover */
.card-premium {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.4s ease;
}

.card-premium:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* Card with border animation */
.card-border-animated {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
}

.card-border-animated::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b5cf6, #ec4899, #6366f1, #8b5cf6);
    background-size: 400% 400%;
    animation: gradientFlow 5s ease infinite;
    border-radius: 14px;
    z-index: -1;
}

/* ===========================================
   LOADING ANIMATIONS
   =========================================== */

/* Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Dots loading */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ===========================================
   SCROLL-TRIGGERED ANIMATIONS (JavaScript controlled)
   =========================================== */

/* Elements that start hidden */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Different animation directions */
[data-animate="fade-left"] {
    transform: translateX(-50px);
}

[data-animate="fade-right"] {
    transform: translateX(50px);
}

[data-animate="fade-up"] {
    transform: translateY(50px);
}

[data-animate="fade-down"] {
    transform: translateY(-50px);
}

[data-animate="zoom-in"] {
    transform: scale(0.8);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ===========================================
   SPECIAL EFFECTS
   =========================================== */

/* Glassmorphism with animation */
.glass-animated {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.glass-animated:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Neon glow effect */
.neon-glow {
    text-shadow:
        0 0 5px #8b5cf6,
        0 0 10px #8b5cf6,
        0 0 20px #8b5cf6,
        0 0 40px #8b5cf6;
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 5px #8b5cf6,
            0 0 10px #8b5cf6,
            0 0 20px #8b5cf6,
            0 0 40px #8b5cf6;
    }
    50% {
        text-shadow:
            0 0 10px #8b5cf6,
            0 0 20px #8b5cf6,
            0 0 40px #8b5cf6,
            0 0 80px #8b5cf6;
    }
}

/* Particle background dots */
.particles-bg {
    position: relative;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #8b5cf6 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.2;
    pointer-events: none;
    animation: particlesDrift 20s linear infinite;
}

@keyframes particlesDrift {
    from { background-position: 0 0; }
    to { background-position: 50px 50px; }
}

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

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

/* Disable heavy animations on mobile for performance */
@media (max-width: 768px) {
    .animate-float,
    .animate-shimmer::after,
    .particles-bg::before {
        animation: none;
    }

    .card-premium:hover {
        transform: translateY(-5px);
    }
}
