/* ========================================
   Tagoals Influencer Application - Animations
   Smooth Transitions and Effects
   ======================================== */

/* ========== Keyframe Animations ========== */

/* Float Animation for Orbs */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-15px, -50px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* Twinkle Animation for Stars */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* Bounce Animation for Scroll Indicator */
@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

/* Scroll Animation for Scroll Indicator Dot */
@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Rotate Animation for Spinner */
@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* Dash Animation for Spinner Path */
@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========== Animation Classes ========== */

/* Fade In with Delays */
.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

/* Slide Animations */
.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slide-down {
    animation: slideDown 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out forwards;
    opacity: 0;
}

/* Scale In */
.animate-scale {
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Pulse Effect */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ========== Hover Effects ========== */

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

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(91, 79, 255, 0.5);
}

/* Lift Effect on Hover */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Scale Effect on Hover */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Brightness Effect on Hover */
.hover-brighten {
    transition: filter 0.3s ease;
}

.hover-brighten:hover {
    filter: brightness(1.2);
}

/* ========== Loading States ========== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-purple);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ========== Transition Classes ========== */

/* Smooth Transitions */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.2s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* ========== Scroll Reveal Effects ========== */

/* Elements Hidden by Default (for scroll reveal) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Page Transition Effects ========== */

/* Smooth Scroll Behavior */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gradient-orb,
    .stars,
    .scroll-indicator {
        animation: none !important;
    }
}

/* ========== Form Animation States ========== */

/* Input Focus Animation */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% {
        box-shadow: 0 0 0 0 rgba(91, 79, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(91, 79, 255, 0.2);
    }
}

/* Error 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);
    }
}

/* Success Checkmark Animation */
.success-checkmark {
    animation: checkmark 0.8s ease;
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* ========== Button Animations ========== */

/* Button Press Animation */
.btn-press:active {
    animation: btnPress 0.2s ease;
}

@keyframes btnPress {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
}

/* Button Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ========== Modal Animations ========== */

/* Modal Backdrop Fade */
.modal {
    animation: fadeIn 0.3s ease;
}

/* Modal Content Slide */
.modal-content {
    animation: slideUp 0.4s ease;
}

/* Modal Exit Animation */
.modal.exit {
    animation: fadeOut 0.3s ease;
}

.modal.exit .modal-content {
    animation: slideDown 0.4s ease;
}

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

/* ========== Progress Animations ========== */

/* Progress Bar Fill */
@keyframes progressFill {
    from {
        width: 0%;
    }
}

.progress-bar {
    animation: progressFill 1s ease-out forwards;
}

/* ========== Text Animations ========== */

/* Typing Effect */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: currentColor;
    }
}

/* Gradient Text Animation */
.animated-gradient-text {
    background: linear-gradient(
        90deg,
        var(--primary-purple),
        var(--primary-blue),
        var(--accent-orange),
        var(--primary-purple)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

/* ========== Responsive Animation Adjustments ========== */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .gradient-orb {
        animation-duration: 30s;
    }
    
    .hover-lift:hover {
        transform: translateY(-3px);
    }
    
    /* Disable some animations on touch devices for performance */
    @media (hover: none) {
        .hover-glow:hover,
        .hover-lift:hover,
        .hover-scale:hover {
            transform: none;
            box-shadow: none;
        }
    }
}
