/* Enhanced Animations CSS for Mouse DPI Website */

/* Smooth Page Transitions */
body {
    opacity: 1;
    transition: opacity 0.3s ease;
}

body.page-transition-out {
    opacity: 0;
}

body.page-transition-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* Enhanced Button Effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.05);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-ripple {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);
}

.card-ripple {
    position: relative;
    overflow: hidden;
}

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

/* 3D Card Tilt Effect */
.tilt-card {
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.tilt-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.tilt-card:hover::after {
    opacity: 1;
}

/* Floating Animation */
.floating {
    animation: float 3s ease-in-out infinite alternate;
}

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

/* Parallax Elements */
.parallax-element {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* Enhanced Cursor Effects */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(52, 152, 219, 0.2);
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s ease;
}

/* Header Scroll Effect */
header {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98);
}

/* Animated Counters */
.counter {
    display: inline-block;
    font-weight: bold;
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
    transform: skewX(-20deg);
}

@keyframes shimmer {
    100% {
        left: 150%;
    }
}

/* Animated Underline for Links */
.animated-underline {
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
    text-decoration: none;
}

.animated-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

/* Gradient Text Animation */
.gradient-text {
    background: linear-gradient(90deg, #3498db, #2ecc71, #3498db);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* Staggered Animation for Grid Items */
.staggered-animation > * {
    opacity: 0;
    transform: translateY(20px);
}

.staggered-animation > *.animate-visible {
    animation: staggered-fade-in 0.5s ease forwards;
}

@keyframes staggered-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.from-bottom {
    transform: translateY(50px);
}

.animate-on-scroll.from-left {
    transform: translateX(-50px);
}

.animate-on-scroll.from-right {
    transform: translateX(50px);
}

.animate-on-scroll.fade-in {
    opacity: 0;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Ripple Animation */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* Hover Glow Effect */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.7);
}

/* Animated Background Gradient */
.animated-bg {
    background: linear-gradient(270deg, #3498db, #2ecc71, #9b59b6);
    background-size: 600% 600%;
    animation: gradient-animation 10s ease infinite;
}

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

/* Fade In Down Animation */
.fade-in-down {
    animation: fadeInDown 1s ease forwards;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Reveal Animation */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section Highlight Animation */
.section-highlight {
    animation: section-highlight 1.5s ease;
}

@keyframes section-highlight {
    0% {
        box-shadow: 0 0 0 rgba(52, 152, 219, 0);
    }
    30% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
    }
    100% {
        box-shadow: 0 0 0 rgba(52, 152, 219, 0);
    }
}

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

/* Staggered Animation for Lists */
.staggered-animation > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.staggered-animation > *.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* Highlight Animation */
.highlight-animation {
    position: relative;
    z-index: 1;
}

.highlight-animation::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: -0.25em;
    right: -0.25em;
    background-color: rgba(52, 152, 219, 0.2);
    transform-origin: center right;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.highlight-animation:hover::before {
    transform-origin: center left;
    transform: scaleX(1);
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fade In Up Animation */
.fade-in-up {
    animation: fadeInUp 0.8s ease-in-out forwards;
    opacity: 0;
}

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

/* Fade In Down Animation */
.fade-in-down {
    animation: fadeInDown 0.8s ease-in-out forwards;
    opacity: 0;
}

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

/* Fade In Left Animation */
.fade-in-left {
    animation: fadeInLeft 0.8s ease-in-out forwards;
    opacity: 0;
}

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

/* Fade In Right Animation */
.fade-in-right {
    animation: fadeInRight 0.8s ease-in-out forwards;
    opacity: 0;
}

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

/* Zoom In Animation */
.zoom-in {
    animation: zoomIn 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom Out Animation */
.zoom-out {
    animation: zoomOut 0.8s ease-in-out forwards;
    opacity: 0;
}

@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flip Animation */
.flip {
    animation: flip 0.8s ease-in-out forwards;
    opacity: 0;
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes flip {
    from {
        opacity: 0;
        transform: rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg);
    }
}

/* Ripple Animation */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Bounce Animation */
.bounce {
    animation: bounce 0.8s ease-in-out forwards;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.8s ease-in-out forwards;
}

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

/* Rotate Animation */
.rotate {
    animation: rotate 0.8s ease-in-out forwards;
}

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

/* Slide In Animation */
.slide-in {
    animation: slideIn 0.8s ease-in-out forwards;
    opacity: 0;
}

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

/* Slide Out Animation */
.slide-out {
    animation: slideOut 0.8s ease-in-out forwards;
}

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

/* Heartbeat Animation */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

/* Typing Animation */
.typing {
    overflow: hidden;
    border-right: 0.15em solid #3498db;
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #3498db }
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* Animate on Scroll Helper Classes */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s, transform 0.8s;
}

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

.from-bottom {
    transform: translateY(50px);
}

.from-top {
    transform: translateY(-50px);
}

.from-left {
    transform: translateX(-50px);
}

.from-right {
    transform: translateX(50px);
}

.from-center {
    transform: scale(0.8);
}

/* Infinite Animations */
.infinite {
    animation-iteration-count: infinite;
}

/* Alternate Animations */
.alternate {
    animation-direction: alternate;
}

/* Ease Animations */
.ease {
    animation-timing-function: ease;
}

.ease-in {
    animation-timing-function: ease-in;
}

.ease-out {
    animation-timing-function: ease-out;
}

.ease-in-out {
    animation-timing-function: ease-in-out;
}

/* Linear Animations */
.linear {
    animation-timing-function: linear;
}

/* Cubic Bezier Animations */
.cubic-bezier {
    animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
}
