/**
 * Container Send Plugin - Ultra Modern Animations
 * Premium SaaS-Level micro-interactions with Glassmorphism
 */

/* ============================================
   CSS Variables for Animations
   ============================================ */
:root {
    --csp-ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --csp-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --csp-ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
    --csp-ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --csp-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --csp-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --csp-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradient Animations */
    --csp-gradient-animated: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 25%,
        #6B8DD6 50%,
        #8E37D7 75%,
        #667eea 100%
    );
}

/* ============================================
   Card Animations
   ============================================ */
.csp-card-animated {
    animation: cspCardEnter 0.6s var(--csp-ease-out-expo) forwards;
}

@keyframes cspCardEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form Card Entrance */
.csp-form-card {
    animation: cspFormCardEnter 0.7s var(--csp-ease-out-expo) forwards;
}

@keyframes cspFormCardEnter {
    0% {
        opacity: 0;
        transform: translateY(40px) rotateX(10deg);
        transform-origin: top center;
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* ============================================
   Button Animations
   ============================================ */
.csp-btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--csp-ease-out-expo);
}

.csp-btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.csp-btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

.csp-btn-animated:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4), 0 5px 15px rgba(0,0,0,0.1);
}

.csp-btn-animated:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Button Loader */
.csp-btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cspSpinSmooth 0.8s linear infinite;
    margin-right: 8px;
}

.csp-btn.loading .csp-btn-text {
    opacity: 0;
}

.csp-btn.loading .csp-btn-loader {
    display: block;
}

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

/* ============================================
   Float Animation (Icons)
   ============================================ */
.csp-float-animation {
    animation: cspFloat 3s ease-in-out infinite;
}

@keyframes cspFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    75% {
        transform: translateY(-4px) rotate(-2deg);
    }
}

/* ============================================
   Shake Animation (Errors)
   ============================================ */
.csp-shake-animation {
    animation: cspShake 0.6s var(--csp-ease-out-expo);
}

@keyframes cspShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-12px) rotate(-1deg); }
    20% { transform: translateX(10px) rotate(1deg); }
    30% { transform: translateX(-8px) rotate(-0.5deg); }
    40% { transform: translateX(6px) rotate(0.5deg); }
    50% { transform: translateX(-4px); }
    60% { transform: translateX(2px); }
}

/* ============================================
   Input Focus Animations
   ============================================ */
.csp-input {
    transition: all 0.3s var(--csp-ease-out-expo);
}

.csp-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.2), 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.csp-input.error {
    animation: cspInputError 0.5s var(--csp-ease-out-expo);
}

@keyframes cspInputError {
    0%, 100% { 
        transform: translateX(0);
        border-color: var(--csp-danger);
    }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ============================================
   OTP Input Animations
   ============================================ */
.csp-otp-input {
    transition: all 0.3s var(--csp-ease-out-back);
}

.csp-otp-input:focus {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    z-index: 10;
}

.csp-otp-input.filled {
    animation: cspOtpFilled 0.4s var(--csp-spring);
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
}

@keyframes cspOtpFilled {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* OTP Error Shake */
.csp-otp-input.error {
    animation: cspOtpError 0.5s var(--csp-ease-out-expo);
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
}

@keyframes cspOtpError {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-6px) rotate(-3deg); }
    40% { transform: translateX(6px) rotate(3deg); }
    60% { transform: translateX(-4px) rotate(-2deg); }
    80% { transform: translateX(4px) rotate(2deg); }
}

/* ============================================
   Upload Zone Animations
   ============================================ */
.csp-upload-zone {
    transition: all 0.4s var(--csp-ease-out-expo);
}

.csp-upload-zone:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.2);
    border-color: var(--csp-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.csp-upload-zone.dragover {
    animation: cspDragPulse 1s ease infinite;
    transform: scale(1.02);
}

@keyframes cspDragPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }
}

.csp-upload-icon svg {
    transition: transform 0.4s var(--csp-ease-out-back);
}

.csp-upload-zone:hover .csp-upload-icon svg {
    transform: translateY(-5px) scale(1.1);
}

/* ============================================
   Progress Bar Animation
   ============================================ */
.csp-progress-fill {
    background: linear-gradient(90deg, var(--csp-primary) 0%, var(--csp-primary-light) 50%, var(--csp-primary) 100%);
    background-size: 200% 100%;
    animation: cspProgressShimmer 1.5s ease infinite;
    transition: width 0.3s ease;
}

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

/* ============================================
   Success Checkmark Animation
   ============================================ */
.csp-checkmark svg {
    filter: drop-shadow(0 4px 15px rgba(16, 185, 129, 0.4));
}

.csp-checkmark circle {
    stroke: var(--csp-success);
    stroke-width: 2;
    fill: rgba(16, 185, 129, 0.1);
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: cspCircleDraw 0.6s 0.2s var(--csp-ease-out-expo) forwards;
}

.csp-checkmark path {
    stroke: var(--csp-success);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: cspCheckDraw 0.4s 0.6s var(--csp-ease-out-back) forwards;
}

@keyframes cspCircleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes cspCheckDraw {
    to { stroke-dashoffset: 0; }
}

/* Success Card Entrance */
.csp-success-card {
    animation: cspSuccessEnter 0.8s var(--csp-ease-out-expo) forwards;
}

@keyframes cspSuccessEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    50% {
        transform: scale(1.02) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   Tracking Code Copy Animation
   ============================================ */
.csp-copy-btn {
    transition: all 0.3s var(--csp-ease-out-expo);
}

.csp-copy-btn.copied {
    animation: cspCopySuccess 0.5s var(--csp-spring);
    background: var(--csp-success) !important;
    color: #fff !important;
}

@keyframes cspCopySuccess {
    0% { transform: scale(1); }
    30% { transform: scale(1.2) rotate(5deg); }
    60% { transform: scale(0.95) rotate(-2deg); }
    100% { transform: scale(1) rotate(0); }
}

/* ============================================
   Timeline Animations
   ============================================ */
.csp-timeline-item {
    opacity: 0;
    transform: translateX(30px);
    animation: cspTimelineEnter 0.5s var(--csp-ease-out-expo) forwards;
}

.csp-timeline-item:nth-child(1) { animation-delay: 0.1s; }
.csp-timeline-item:nth-child(2) { animation-delay: 0.2s; }
.csp-timeline-item:nth-child(3) { animation-delay: 0.3s; }
.csp-timeline-item:nth-child(4) { animation-delay: 0.4s; }
.csp-timeline-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes cspTimelineEnter {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.csp-timeline-dot {
    transition: all 0.3s var(--csp-ease-out-back);
}

.csp-timeline-item:hover .csp-timeline-dot {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px var(--csp-bg), 0 0 15px var(--status-color, var(--csp-primary));
}

/* ============================================
   Media Card Animations
   ============================================ */
.csp-media-card {
    transition: all 0.4s var(--csp-ease-out-expo);
}

.csp-media-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

.csp-media-card img,
.csp-media-card video {
    transition: transform 0.5s var(--csp-ease-out-expo);
}

.csp-media-card:hover img,
.csp-media-card:hover video {
    transform: scale(1.08);
}

/* New Media Entry Animation */
.csp-media-card.new {
    animation: cspMediaEnter 0.6s var(--csp-ease-out-back);
}

@keyframes cspMediaEnter {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    60% {
        transform: scale(1.05) rotate(1deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* ============================================
   Product Card Animations
   ============================================ */
.csp-product-card {
    transition: all 0.4s var(--csp-ease-out-expo);
}

.csp-product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.15);
}

.csp-product-card:hover img {
    transform: scale(1.1);
}

.csp-product-card .csp-product-cta {
    transition: all 0.3s var(--csp-ease-out-expo);
}

.csp-product-card:hover .csp-product-cta {
    background: linear-gradient(135deg, var(--csp-primary) 0%, var(--csp-primary-dark) 100%);
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================
   Modal Animations
   ============================================ */
.csp-modal.active .csp-modal-backdrop {
    animation: cspBackdropEnter 0.3s ease forwards;
}

@keyframes cspBackdropEnter {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

.csp-modal.active .csp-modal-container {
    animation: cspModalEnter 0.5s var(--csp-spring) forwards;
}

@keyframes cspModalEnter {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Step Indicator Animations
   ============================================ */
.csp-step {
    transition: all 0.4s var(--csp-ease-out-expo);
}

.csp-step.active .csp-step-number {
    animation: cspStepActive 0.5s var(--csp-spring);
}

@keyframes cspStepActive {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.csp-step.completed .csp-step-number {
    animation: cspStepComplete 0.6s var(--csp-ease-out-back);
}

@keyframes cspStepComplete {
    0% { transform: scale(1) rotate(0); }
    30% { transform: scale(1.3) rotate(-10deg); }
    60% { transform: scale(0.9) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

/* Step Line Progress */
.csp-step-line::after {
    transition: width 0.6s var(--csp-ease-out-expo);
}

/* ============================================
   Loading States
   ============================================ */
.csp-spinner {
    border: 3px solid var(--csp-border);
    border-top-color: var(--csp-primary);
    animation: cspSpin 0.8s linear infinite;
}

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

/* Skeleton Loading */
.csp-skeleton {
    background: linear-gradient(
        90deg,
        var(--csp-bg-secondary) 25%,
        var(--csp-bg-tertiary) 50%,
        var(--csp-bg-secondary) 75%
    );
    background-size: 400% 100%;
    animation: cspSkeleton 1.5s ease infinite;
}

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

/* ============================================
   Limit Exceeded Animation
   ============================================ */
.csp-limit-card {
    animation: cspLimitEnter 0.8s var(--csp-ease-out-expo) forwards;
}

@keyframes cspLimitEnter {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.csp-limit-icon {
    animation: cspWarningPulse 2s ease infinite;
}

@keyframes cspWarningPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ============================================
   Ripple Effect (Buttons)
   ============================================ */
@keyframes csp-ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.csp-btn-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 60%);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   Glow Effects
   ============================================ */
.csp-glow-primary {
    animation: cspGlowPrimary 2s ease-in-out infinite;
}

@keyframes cspGlowPrimary {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3),
                    0 0 15px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.5),
                    0 0 30px rgba(99, 102, 241, 0.3);
    }
}

.csp-glow-success {
    animation: cspGlowSuccess 2s ease-in-out infinite;
}

@keyframes cspGlowSuccess {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.3),
                    0 0 15px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.5),
                    0 0 30px rgba(16, 185, 129, 0.3);
    }
}

/* ============================================
   Stagger Children
   ============================================ */
.csp-stagger > * {
    opacity: 0;
    animation: cspStaggerChild 0.5s var(--csp-ease-out-expo) forwards;
}

.csp-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.csp-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.csp-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.csp-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.csp-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.csp-stagger > *:nth-child(6) { animation-delay: 0.3s; }

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

/* ============================================
   Modern Glassmorphism Effects
   ============================================ */
.csp-glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.csp-glass-dark {
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Premium Gradient Border Animation
   ============================================ */
.csp-gradient-border {
    position: relative;
    background: var(--csp-bg);
    border-radius: 16px;
}

.csp-gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(
        90deg,
        #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe, #667eea
    );
    background-size: 300% 100%;
    animation: cspGradientBorder 4s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.csp-gradient-border:hover::before,
.csp-gradient-border:focus-within::before {
    opacity: 1;
}

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

/* ============================================
   Floating Particles Animation
   ============================================ */
.csp-particles {
    position: relative;
    overflow: hidden;
}

.csp-particles::before,
.csp-particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    opacity: 0.5;
    pointer-events: none;
}

.csp-particles::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation: cspParticleFloat 8s ease-in-out infinite;
}

.csp-particles::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: cspParticleFloat 10s ease-in-out infinite reverse;
}

@keyframes cspParticleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(20px, 10px) scale(1.05); }
}

/* ============================================
   3D Card Tilt on Hover
   ============================================ */
.csp-card-3d {
    transition: transform 0.5s var(--csp-smooth);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.csp-card-3d:hover {
    transform: perspective(1000px) rotateX(3deg) rotateY(-3deg) translateZ(10px);
}

/* ============================================
   Morphing Background Animation
   ============================================ */
.csp-morph-bg {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 400% 400%;
    animation: cspMorphGradient 15s ease infinite;
}

@keyframes cspMorphGradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   Liquid Button Effect
   ============================================ */
.csp-btn-liquid {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.csp-btn-liquid::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s var(--csp-smooth), height 0.6s var(--csp-smooth);
    z-index: -1;
}

.csp-btn-liquid:hover::before {
    width: 400px;
    height: 400px;
}

.csp-btn-liquid::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.3), transparent);
    transition: height 0.4s var(--csp-smooth);
    z-index: -1;
}

.csp-btn-liquid:hover::after {
    height: 100%;
}

/* ============================================
   Text Shimmer Effect
   ============================================ */
.csp-text-shimmer {
    background: linear-gradient(
        90deg,
        var(--csp-text) 0%,
        var(--csp-primary) 50%,
        var(--csp-text) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: cspTextShimmer 3s linear infinite;
}

@keyframes cspTextShimmer {
    to { background-position: 200% center; }
}

/* ============================================
   Pulse Ring Animation
   ============================================ */
.csp-pulse-ring {
    position: relative;
}

.csp-pulse-ring::before,
.csp-pulse-ring::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid var(--csp-primary);
    opacity: 0;
}

.csp-pulse-ring::before {
    animation: cspPulseRing 2s ease-out infinite;
}

.csp-pulse-ring::after {
    animation: cspPulseRing 2s ease-out infinite 1s;
}

@keyframes cspPulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   Bouncy Icon Animation
   ============================================ */
.csp-icon-bounce {
    display: inline-block;
    animation: cspIconBounce 2s var(--csp-bounce) infinite;
}

@keyframes cspIconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-8px); }
}

/* ============================================
   Magnetic Button Effect
   ============================================ */
.csp-btn-magnetic {
    transition: transform 0.3s var(--csp-smooth);
}

/* ============================================
   Neon Glow Effect
   ============================================ */
.csp-neon-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        0 0 40px currentColor;
    animation: cspNeonFlicker 1.5s ease-in-out infinite alternate;
}

@keyframes cspNeonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ============================================
   Typewriter Effect
   ============================================ */
.csp-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-left: 3px solid var(--csp-primary);
    animation: 
        cspTyping 3s steps(30, end),
        cspBlinkCursor 0.75s step-end infinite;
}

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

@keyframes cspBlinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--csp-primary); }
}

/* ============================================
   Smooth Reveal Animation
   ============================================ */
.csp-reveal {
    opacity: 0;
    transform: translateY(40px);
    animation: cspReveal 0.8s var(--csp-ease-out-expo) forwards;
}

.csp-reveal-delay-1 { animation-delay: 0.1s; }
.csp-reveal-delay-2 { animation-delay: 0.2s; }
.csp-reveal-delay-3 { animation-delay: 0.3s; }
.csp-reveal-delay-4 { animation-delay: 0.4s; }
.csp-reveal-delay-5 { animation-delay: 0.5s; }

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

/* ============================================
   Confetti Effect
   ============================================ */
.csp-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--csp-primary);
    opacity: 0;
}

.csp-confetti.active {
    animation: cspConfettiFall 3s ease-out forwards;
}

@keyframes cspConfettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   Success Celebration Animation
   ============================================ */
.csp-celebration {
    position: relative;
}

.csp-celebration::before {
    content: '🎉';
    position: absolute;
    font-size: 2rem;
    top: -20px;
    left: 10%;
    opacity: 0;
    animation: cspCelebrate 1s var(--csp-ease-out-back) forwards;
}

.csp-celebration::after {
    content: '🎊';
    position: absolute;
    font-size: 2rem;
    top: -20px;
    right: 10%;
    opacity: 0;
    animation: cspCelebrate 1s var(--csp-ease-out-back) 0.2s forwards;
}

@keyframes cspCelebrate {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
}

/* ============================================
   Wave Loading Animation
   ============================================ */
.csp-wave-loader {
    display: flex;
    gap: 4px;
}

.csp-wave-loader span {
    width: 6px;
    height: 24px;
    background: var(--csp-primary);
    border-radius: 3px;
    animation: cspWave 1.2s ease-in-out infinite;
}

.csp-wave-loader span:nth-child(1) { animation-delay: 0s; }
.csp-wave-loader span:nth-child(2) { animation-delay: 0.1s; }
.csp-wave-loader span:nth-child(3) { animation-delay: 0.2s; }
.csp-wave-loader span:nth-child(4) { animation-delay: 0.3s; }
.csp-wave-loader span:nth-child(5) { animation-delay: 0.4s; }

@keyframes cspWave {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* ============================================
   Orbit Animation
   ============================================ */
.csp-orbit {
    position: relative;
}

.csp-orbit::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--csp-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: -30px center;
    animation: cspOrbit 2s linear infinite;
}

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

/* ============================================
   Focus Ring Animation
   ============================================ */
.csp-focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 4px transparent;
    animation: cspFocusRing 0.3s var(--csp-smooth) forwards;
}

@keyframes cspFocusRing {
    to {
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
    }
}

/* ============================================
   Slide Transitions
   ============================================ */
.csp-slide-up {
    animation: cspSlideUp 0.5s var(--csp-ease-out-expo) forwards;
}

.csp-slide-down {
    animation: cspSlideDown 0.5s var(--csp-ease-out-expo) forwards;
}

.csp-slide-left {
    animation: cspSlideLeft 0.5s var(--csp-ease-out-expo) forwards;
}

.csp-slide-right {
    animation: cspSlideRight 0.5s var(--csp-ease-out-expo) forwards;
}

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

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

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

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

/* ============================================
   Scale Transitions
   ============================================ */
.csp-scale-in {
    animation: cspScaleIn 0.4s var(--csp-bounce) forwards;
}

.csp-scale-out {
    animation: cspScaleOut 0.3s var(--csp-smooth) forwards;
}

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

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

/* ============================================
   Heartbeat Effect
   ============================================ */
.csp-heartbeat {
    animation: cspHeartbeat 1.5s ease-in-out infinite;
}

@keyframes cspHeartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
}

/* ============================================
   Jelly Effect
   ============================================ */
.csp-jelly:hover {
    animation: cspJelly 0.5s var(--csp-smooth);
}

@keyframes cspJelly {
    0% { transform: scale(1, 1); }
    30% { transform: scale(1.15, 0.85); }
    40% { transform: scale(0.85, 1.15); }
    50% { transform: scale(1.08, 0.92); }
    65% { transform: scale(0.95, 1.05); }
    75% { transform: scale(1.03, 0.97); }
    100% { transform: scale(1, 1); }
}

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