/* ===================================================================
   Animations & Micro-interactions
   Advanced animations for enhanced user experience
   =================================================================== */

/* ===================================================================
   Scroll Reveal Animations
   =================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
}

.reveal.active {
    animation: fadeInUp 0.6s ease forwards;
}

.reveal-left {
    opacity: 0;
}

.reveal-left.active {
    animation: slideInLeft 0.6s ease forwards;
}

.reveal-right {
    opacity: 0;
}

.reveal-right.active {
    animation: slideInRight 0.6s ease forwards;
}

.reveal-scale {
    opacity: 0;
}

.reveal-scale.active {
    animation: scaleIn 0.6s ease forwards;
}

/* Delay classes for staggered animations */
.delay-1 {
    animation-delay: 0.1s;
}

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

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

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

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

/* ===================================================================
   Pulse & Glow Effects
   =================================================================== */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(29, 161, 242, 0.5),
            0 0 10px rgba(29, 161, 242, 0.3),
            0 0 15px rgba(29, 161, 242, 0.1);
    }

    50% {
        box-shadow: 0 0 10px rgba(29, 161, 242, 0.8),
            0 0 20px rgba(29, 161, 242, 0.5),
            0 0 30px rgba(29, 161, 242, 0.3);
    }
}

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

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

/* ===================================================================
   Loading & Skeleton Animations
   =================================================================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1DA1F2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ===================================================================
   Ripple Effect
   =================================================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    transition: 0s;
}

/* ===================================================================
   Floating Animation
   =================================================================== */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

/* ===================================================================
   Slide Underline Effect
   =================================================================== */
.underline-slide {
    position: relative;
    display: inline-block;
}

.underline-slide::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1DA1F2;
    transition: width 0.3s ease;
}

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

/* ===================================================================
   Gradient Animation
   =================================================================== */
@keyframes gradient-rotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(270deg, #667eea, #764ba2, #f093fb);
    background-size: 600% 600%;
    animation: gradient-rotate 8s ease infinite;
}

/* ===================================================================
   Shake Animation (for errors or attention)
   =================================================================== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.6s;
}

/* ===================================================================
   Rotate In Animation
   =================================================================== */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }

    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease;
}

/* ===================================================================
   Progress Bar Animation
   =================================================================== */
@keyframes progress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #1DA1F2, #667eea);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ===================================================================
   Attention Seeker - Bounce
   =================================================================== */
@keyframes bounce-attention {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-15px);
    }

    60% {
        transform: translateY(-10px);
    }
}

.bounce-attention {
    animation: bounce-attention 1s;
}

/* ===================================================================
   Flip Animation
   =================================================================== */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }

    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

.flip {
    animation: flip 0.6s;
}

/* ===================================================================
   Heartbeat Animation
   =================================================================== */
@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* ===================================================================
   Typing Effect
   =================================================================== */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

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

.typing {
    overflow: hidden;
    border-right: 2px solid #1DA1F2;
    white-space: nowrap;
    animation: typing 3.5s steps(40) 1s 1 normal both,
        blink 0.75s step-end infinite;
}

/* ===================================================================
   Fade Out Animations
   =================================================================== */
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

.fade-out-down {
    animation: fadeOutDown 0.5s ease forwards;
}

/* ===================================================================
   ZoomIn Animation
   =================================================================== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
    }

    to {
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease;
}

/* ===================================================================
   Blur In Animation
   =================================================================== */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-in {
    animation: blurIn 0.6s ease;
}

/* ===================================================================
   Page Transition
   =================================================================== */
.page-transition {
    animation: fadeIn 0.5s ease;
}

/* ===================================================================
   Reduced Motion Support
   =================================================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}