/* 
================================================
CUSTOM ANIMATIONS - Taka Web
================================================
Modern, professional animations for enhanced UX
================================================
*/

/* ========================================
   1. SPLASH CURSOR EFFECT
   ======================================== */
.splash-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.splash {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0) 70%);
    animation: splash-animation 0.8s ease-out forwards;
    transform: translate(-50%, -50%);
}

@keyframes splash-animation {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* Custom cursor trail */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.3);
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: cursor-pulse 1.5s infinite;
}

@keyframes cursor-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   2. SCROLL REVEAL ANIMATIONS
   ======================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for sequential reveals */
.scroll-reveal:nth-child(1) {
    transition-delay: 0.1s;
}

.scroll-reveal:nth-child(2) {
    transition-delay: 0.2s;
}

.scroll-reveal:nth-child(3) {
    transition-delay: 0.3s;
}

.scroll-reveal:nth-child(4) {
    transition-delay: 0.4s;
}

.scroll-reveal:nth-child(5) {
    transition-delay: 0.5s;
}

.scroll-reveal:nth-child(6) {
    transition-delay: 0.6s;
}

/* ========================================
   3. FLOATING ANIMATIONS
   ======================================== */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.float-slow {
    animation: float-slow 4s ease-in-out infinite;
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* ========================================
   4. ENHANCED HOVER EFFECTS
   ======================================== */
.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);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ========================================
   5. GRADIENT ANIMATIONS
   ======================================== */
.gradient-shift {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   6. LOADING ANIMATIONS
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner {
    border: 3px solid rgba(34, 197, 94, 0.1);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spinner-rotation 0.8s linear infinite;
}

@keyframes spinner-rotation {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   7. TEXT ANIMATIONS
   ======================================== */
.text-shimmer {
    background: linear-gradient(90deg, #374151 0%, #22c55e 50%, #374151 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s linear infinite;
}

@keyframes text-shimmer {
    to {
        background-position: 200% center;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #22c55e;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
        blink-cursor 0.75s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-cursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #22c55e;
    }
}

/* ========================================
   8. BOUNCE & WIGGLE EFFECTS
   ======================================== */
.bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.wiggle {
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

/* ========================================
   9. RIPPLE EFFECT
   ======================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   10. PARALLAX & DEPTH
   ======================================== */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.depth-shadow {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
}

.depth-shadow:hover {
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.15),
        0 10px 10px rgba(0, 0, 0, 0.12);
}

/* ========================================
   11. PAGE TRANSITION
   ======================================== */
.page-transition {
    animation: page-fade-in 0.5s ease-in-out;
}

@keyframes page-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   12. CARD FLIP
   ======================================== */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ========================================
   13. GLOW PULSE
   ======================================== */
.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(34, 197, 94, 0.6);
    }
}

/* ========================================
   14. SLIDE IN ANIMATIONS
   ======================================== */
.slide-in-bottom {
    animation: slide-in-bottom 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slide-in-bottom {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-top {
    animation: slide-in-top 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slide-in-top {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   15. SMOOTH TRANSITIONS
   ======================================== */
.smooth-all {
    transition: all 0.3s ease-in-out;
}

.smooth-transform {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.smooth-opacity {
    transition: opacity 0.3s ease-in-out;
}

/* ========================================
   16. ATTENTION SEEKERS
   ======================================== */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(0.9);
    }

    20%,
    40%,
    60%,
    80% {
        transform: scale(1.1);
    }

    50%,
    70% {
        transform: scale(1.05);
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

/* ========================================
   17. PAGE LOADER ANIMATIONS
   ======================================== */
/* Modern loader background with gradient */
#page-loader {
    /* green-500 = #22c55e, at 10% opacity = rgba(34, 197, 94, 0.1) */
    /* background-color: rgba(34, 197, 94, 0.25); */
    backdrop-filter: blur(10px);
}

/* Logo container animations */
.loader-logo-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo wrapper - Perfect centering */
.loader-logo-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Logo pulse and glow animation */
.loader-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logo-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.5));
}

@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.5));
    }

    50% {
        transform: scale(1.08);
        filter: drop-shadow(0 0 40px rgba(34, 197, 94, 0.9));
    }
}

/* Circular progress ring around logo */
.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.loader-ring circle {
    fill: none;
    stroke: rgba(34, 197, 94, 0.15);
    stroke-width: 2.5;
    stroke-linecap: round;
    transform-origin: center;
}

.loader-ring .progress-circle {
    stroke: #22c55e;
    stroke-width: 3;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    animation: progress-animation 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
}

@keyframes progress-animation {
    0% {
        stroke-dashoffset: 565;
        transform: rotate(0deg);
    }

    50% {
        stroke-dashoffset: 141;
    }

    100% {
        stroke-dashoffset: 565;
        transform: rotate(360deg);
    }
}

/* Orbiting dots around logo */
.loader-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    transform: translate(-50%, -50%);
    animation: orbit-rotate 4s linear infinite;
    z-index: 5;
}

@keyframes orbit-rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.loader-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.8);
}

.loader-dot:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation: dot-pulse 1.5s ease-in-out 0.375s infinite;
}

.loader-dot:nth-child(3) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: dot-pulse 1.5s ease-in-out 0.75s infinite;
}

.loader-dot:nth-child(4) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation: dot-pulse 1.5s ease-in-out 1.125s infinite;
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.5);
    }
}



/* Shimmer effect on load */
.loader-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    animation: shimmer 3s infinite;
    z-index: 15;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Fade out animation when page loads */
.loader-fade-out {
    animation: fade-out 0.5s ease-out forwards;
}

@keyframes fade-out {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {

    /* Reduce animation intensity on mobile for performance */
    .splash {
        animation-duration: 0.5s;
    }

    .float,
    .float-slow {
        animation: none;
    }

    .parallax-bg {
        background-attachment: scroll;
    }
}

/* 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;
    }
}