/* 
* Meta Global - Animation Styles
* Professional animations for HYP investment platform
*/

/* ===== BASE ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInDown {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translate3d(-100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInRight {
    from {
        transform: translate3d(100%, 0, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bounce {
    from, 20%, 53%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -10px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes pulse {
    from {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes shake {
    from, to {
        transform: translate3d(0, 0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate3d(-5px, 0, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate3d(5px, 0, 0);
    }
}

@keyframes tada {
    from {
        transform: scale3d(1, 1, 1);
    }
    10%, 20% {
        transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    }
    40%, 60%, 80% {
        transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 0 20px rgba(52, 152, 219, 0.8); }
    100% { box-shadow: 0 0 5px rgba(52, 152, 219, 0.5); }
}

/* ===== ENTRANCE ANIMATIONS ===== */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

/* ===== ATTENTION ANIMATIONS ===== */
.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s;
}

.animate-tada {
    animation: tada 0.8s;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ===== DELAYED ANIMATIONS ===== */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

.animate-delay-6 {
    animation-delay: 0.6s;
}

.animate-delay-7 {
    animation-delay: 0.7s;
}

.animate-delay-8 {
    animation-delay: 0.8s;
}

.animate-delay-9 {
    animation-delay: 0.9s;
}

.animate-delay-10 {
    animation-delay: 1s;
}

/* ===== DURATION ANIMATIONS ===== */
.animate-fast {
    animation-duration: 0.3s;
}

.animate-normal {
    animation-duration: 0.6s;
}

.animate-slow {
    animation-duration: 1s;
}

.animate-slower {
    animation-duration: 1.5s;
}

/* ===== PAGE TRANSITIONS ===== */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s, transform 0.4s;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.4s;
}

/* ===== LOADING ANIMATIONS ===== */
.loading-dots {
    display: inline-flex;
    align-items: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background-color: currentColor;
    border-radius: 50%;
    display: inline-block;
    animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.progress-bar-indeterminate {
    position: relative;
    overflow: hidden;
    height: 4px;
}

.progress-bar-indeterminate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50%;
    background-color: var(--secondary-color);
    animation: progress-indeterminate 1.5s infinite ease-in-out;
}

@keyframes progress-indeterminate {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* ===== BUTTON ANIMATIONS ===== */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-animate::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-animate:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(50, 50);
        opacity: 0.3;
    }
    100% {
        transform: scale(100, 100);
        opacity: 0;
    }
}

.btn-hover-lift {
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ===== CARD ANIMATIONS ===== */
.card-hover {
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-hover-glow {
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-hover-glow:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.2);
}

/* ===== NAVIGATION ANIMATIONS ===== */
.nav-item-slide {
    position: relative;
}

.nav-item-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.nav-item-slide:hover::after {
    width: 100%;
}

/* ===== STATS COUNTER ANIMATION ===== */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ===== INVESTMENT PLAN ANIMATIONS ===== */
.plan-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.plan-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.plan-card.featured {
    animation: pulse 2s infinite;
}

/* ===== TRADING CHART ANIMATIONS ===== */
.trading-chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: chart-draw 2s ease-in-out forwards;
}

@keyframes chart-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* ===== NOTIFICATION ANIMATIONS ===== */
.notification-slide {
    animation: notificationSlideIn 0.5s forwards, notificationSlideOut 0.5s forwards 2.5s;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== KYC VERIFICATION ANIMATIONS ===== */
.verification-badge {
    position: relative;
}

.verification-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: #27ae60;
    border-radius: 50%;
    border: 2px solid white;
    animation: verification-pulse 2s infinite;
}

@keyframes verification-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

/* ===== REFERRAL SYSTEM ANIMATIONS ===== */
.refral-chain {
    position: relative;
}

.refral-chain::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    width: 15px;
    height: 2px;
    background-color: #ddd;
}

.refral-chain::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -20px;
    height: calc(100% + 20px);
    width: 2px;
    background-color: #ddd;
}

.refral-chain:first-child::after {
    top: 50%;
    height: calc(50% + 10px);
}

.refral-chain:last-child::after {
    height: calc(50% + 10px);
}

/* ===== TASK COMPLETION ANIMATIONS ===== */
.task-complete {
    position: relative;
    overflow: hidden;
}

.task-complete::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: task-shine 2s infinite;
}

@keyframes task-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===== WITHDRAWAL PROCESS ANIMATIONS ===== */
.withdrawal-processing {
    position: relative;
}

.withdrawal-processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: withdrawal-shine 1.5s infinite;
}

@keyframes withdrawal-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== DAILY TRADING BUTTON ANIMATIONS ===== */
.trading-button-pulse {
    animation: trading-pulse 2s infinite;
}

@keyframes trading-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(241, 196, 15, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
    }
}

.trading-button-disabled {
    position: relative;
    overflow: hidden;
}

.trading-button-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: trading-shine 1.5s infinite;
}

@keyframes trading-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (max-width: 768px) {
    .animate-mobile-fade-in-up {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .animate-mobile-slide-in-right {
        animation: slideInRight 0.8s ease-out;
    }
}

/* ===== ANIMATION UTILITY CLASSES ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.animation-staggered > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s, transform 0.6s;
}

.animation-staggered.animated > * {
    opacity: 1;
    transform: translateY(0);
}

.animation-staggered.animated > *:nth-child(1) { transition-delay: 0.1s; }
.animation-staggered.animated > *:nth-child(2) { transition-delay: 0.2s; }
.animation-staggered.animated > *:nth-child(3) { transition-delay: 0.3s; }
.animation-staggered.animated > *:nth-child(4) { transition-delay: 0.4s; }
.animation-staggered.animated > *:nth-child(5) { transition-delay: 0.5s; }
.animation-staggered.animated > *:nth-child(6) { transition-delay: 0.6s; }

/* ===== PREFERS-REDUCED-MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}