/* ============================================
   ANIMATIONS & MICRO-INTERACTIONS
   ============================================ */

/* Ripple Effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    width: 100px;
    height: 100px;
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    from {
        transform: scale(0);
        opacity: 1;
    }

    to {
        transform: scale(4);
        opacity: 0;
    }
}

:root.dark-theme .ripple-effect {
    background-color: rgba(37, 99, 235, 0.2) !important;
}

/* Scroll Animations */
[data-animate],
.fade-in-up,
.fade-in-left,
.fade-in-right,
.scale-in,
.slide-in {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up {
    transform: translateY(30px);
}

.fade-in-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    transform: translateX(-30px);
}

.fade-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    transform: translateX(30px);
}

.fade-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    transform: scale(0.9);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

.slide-in {
    transform: translateY(50px);
}

.slide-in.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-item-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Image Reveal */
[data-reveal] {
    position: relative;
    overflow: hidden;
}

[data-reveal]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-alt);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

[data-reveal].revealed::after {
    transform: translateX(100%);
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

:root.dark-theme .hover-lift:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Hover Glow Effect */
.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hover-glow:hover::before {
    width: 300px;
    height: 300px;
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Rotate on Hover */
.rotate-hover {
    transition: transform 0.3s ease;
}

.rotate-hover:hover {
    transform: rotate(5deg);
}

/* Scale on Hover */
.scale-hover {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Navbar Scroll Animations */
.header.scroll-down {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.header.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Tilt Effect */
[data-tilt] {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Magnetic Effect */
[data-magnetic] {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Gradient Animation */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Loading Spinner */
.spinner-animate {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Fade Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.6s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Slide Animations */
.slide-up {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Zoom In Animation */
.zoom-in {
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Interactive Card Hover */
.interactive-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.interactive-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

:root.dark-theme .interactive-card:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Button Press Animation */
.btn-press {
    position: relative;
    transition: transform 0.1s ease;
}

.btn-press:active {
    transform: scale(0.95);
}

/* Underline Expand on Hover */
.underline-expand {
    position: relative;
}

.underline-expand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease, left 0.3s ease;
}

.underline-expand:hover::after {
    width: 100%;
    left: 0;
}

/* Icon Rotate on Hover */
.icon-rotate {
    transition: transform 0.3s ease;
}

.icon-rotate:hover {
    transform: rotate(360deg);
}

/* Smooth Opacity Transition */
.opacity-transition {
    transition: opacity 0.3s ease;
}

.opacity-transition:hover {
    opacity: 0.8;
}

/* Shadow Lift */
.shadow-lift {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.shadow-lift:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        width: 0;
    }
}

.animate-progress {
    animation: progress 1.5s ease-out forwards;
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}