/* ========================================
   ANIMATIONS.CSS - All Orbit Animations
   ======================================== */

/* ----- PULSE ANIMATIONS ----- */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.35; 
        transform: scale(0.92);
    }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 217, 138, 0.5);
    }
    100% {
        box-shadow: 0 0 0 12px rgba(56, 217, 138, 0);
    }
}

/* ----- DRAW ANIMATIONS ----- */
@keyframes drawLine {
    to { 
        stroke-dashoffset: 0; 
    }
}

@keyframes fadeIn {
    to { 
        opacity: 1; 
    }
}

/* ----- DOT ANIMATIONS ----- */
@keyframes dotPulse {
    0%, 100% { 
        r: 5; 
        opacity: 1;
    }
    50% { 
        r: 8; 
        opacity: 0.6;
    }
}

/* ----- SLIDE & FADE ANIMATIONS ----- */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scalePop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pop {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.12); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* ----- FLOAT ANIMATIONS ----- */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-12px); 
    }
}

/* ----- GLOW ANIMATIONS ----- */
@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 8px rgba(255, 90, 46, 0.3);
    }
    50% {
        text-shadow: 0 0 24px rgba(255, 90, 46, 0.7);
    }
}

/* ----- PARTICLE ANIMATION ----- */
@keyframes particleDrift {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120vh) rotate(720deg);
        opacity: 0;
    }
}

/* ----- NOTIFICATION ANIMATION ----- */
@keyframes notificationSlide {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    10% {
        transform: translateX(0);
        opacity: 1;
    }
    90% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ----- UTILITY ANIMATION CLASSES ----- */
.animate-slide-up { animation: fadeSlideUp 0.6s ease-out forwards; }
.animate-slide-down { animation: fadeSlideDown 0.6s ease-out forwards; }
.animate-scale-in { animation: scalePop 0.5s ease-out forwards; }
.animate-pop { animation: pop 0.3s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glowPulse 2s ease-in-out infinite; }

/* ----- STAGGER CHILDREN ----- */
.stagger-children > * {
    opacity: 0;
    animation: fadeSlideUp 0.6s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* ----- SCROLL-TRIGGERED ANIMATIONS ----- */
.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----- REDUCED MOTION ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .stagger-children > * {
        opacity: 1 !important;
        animation: none !important;
    }
    .fade-section {
        opacity: 1 !important;
        transform: none !important;
    }
}
/* ==========================================
   AUTH MODAL ANIMATIONS
   ========================================== */

/* ----- MODAL OVERLAY ----- */
.modal-overlay {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ----- MODAL CARD FLIP ----- */
.modal-card {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-card.flipped {
    transform: rotateY(180deg);
}

.modal-face {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.modal-back {
    transform: rotateY(180deg);
}

/* ----- MODAL SCALE ANIMATION ----- */
.modal-card:not(.flipped) .modal-front {
    animation: modalScaleIn 0.4s ease-out;
}

.modal-card.flipped .modal-back {
    animation: modalScaleIn 0.4s ease-out;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- INPUT FOCUS ANIMATION ----- */
.auth-form .form-group input:focus {
    animation: inputGlow 0.3s ease-out;
}

@keyframes inputGlow {
    from {
        box-shadow: 0 0 0 0 rgba(56, 217, 138, 0);
    }
    to {
        box-shadow: 0 0 0 3px rgba(56, 217, 138, 0.15);
    }
}

/* ----- BUTTON LOADING ANIMATION ----- */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----- SUCCESS STATE ANIMATION ----- */
.success-content {
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    animation: successIconBounce 0.6s ease-out 0.2s both;
}

@keyframes successIconBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}
/* ========================================
   GRAPH ANIMATIONS
   ======================================== */

/* ----- DRAW LINE ----- */
@keyframes drawLine {
    to { 
        stroke-dashoffset: 0; 
    }
}

/* ----- FADE IN ----- */
@keyframes fadeIn {
    to { 
        opacity: 1; 
    }
}

/* ----- DOT PULSE ----- */
@keyframes dotPulse {
    0%, 100% { 
        r: 5; 
        opacity: 1;
    }
    50% { 
        r: 8; 
        opacity: 0.6;
    }
}

/* ----- GLOW PULSE for graph ----- */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(56, 217, 138, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(56, 217, 138, 0.6));
    }
}

.traj-dot {
    animation: dotPulse 1.8s ease-in-out infinite 1.6s, glowPulse 2s ease-in-out infinite;
}