/**
 * Global Animations & Micro-interactions
 * LensLink AI - Enhanced UX
 */

/* === LOADING STATES === */

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

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

.loading-skeleton {
    background: linear-gradient(
        90deg,
        #161b22 25%,
        #21262d 50%,
        #161b22 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; }
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: #58a6ff;
    border-radius: 50%;
    animation: loading-dot 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-dot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === FADE ANIMATIONS === */

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-in-slow {
    animation: fadeIn 0.6s ease-in;
}

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

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

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

/* === SLIDE ANIMATIONS === */

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.4s ease-out;
}

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

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

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

/* === SCALE ANIMATIONS === */

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* === BUTTON MICRO-INTERACTIONS === */

.btn-interactive {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.btn-interactive:active::before {
    width: 300px;
    height: 300px;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

.btn-hover-lift:active {
    transform: translateY(0);
}

/* === CARD MICRO-INTERACTIONS === */

.card-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-interactive:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.15);
}

.card-interactive:active {
    transform: translateY(-2px);
}

/* === 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(88, 166, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

/* === FLOATING ANIMATION === */

.float {
    animation: float 3s ease-in-out infinite;
}

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

/* === SHIMMER EFFECT === */

.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(88, 166, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

/* === BOUNCE === */

.bounce {
    animation: bounce 1s ease infinite;
}

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

/* === SHAKE === */

.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/ERROR STATES === */

.success-flash {
    animation: successFlash 0.6s ease;
}

@keyframes successFlash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(35, 134, 54, 0.2);
    }
}

.error-flash {
    animation: errorFlash 0.6s ease;
}

@keyframes errorFlash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(248, 81, 73, 0.2);
    }
}

/* === TOOLTIP ANIMATION === */

.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 8px 12px;
    background-color: #21262d;
    color: #e0e0e0;
    border: 1px solid #30363d;
    border-radius: 5px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* === PROGRESS BAR === */

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #21262d;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #238636, #58a6ff);
    transition: width 0.3s ease;
}

.progress-bar-animated {
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* === NOTIFICATION SLIDE === */

.notification {
    animation: notificationSlide 0.4s ease-out;
}

@keyframes notificationSlide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === FOCUS STATES === */

.focus-ring:focus {
    outline: 2px solid #58a6ff;
    outline-offset: 2px;
}

.focus-glow:focus {
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3);
}

/* === STAGGER ANIMATION (for lists) === */

.stagger-item {
    animation: fadeIn 0.5s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* === UTILITY CLASSES === */

.transition-all {
    transition: all 0.3s ease;
}

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

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

.no-transition {
    transition: none !important;
}

/* === HOVER GLOW === */

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
}

/* === TYPING INDICATOR === */

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 10px 15px;
    background-color: #21262d;
    border-radius: 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #58a6ff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* === REDUCE MOTION === */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}






