/**
 * Animation Styles for Coordinate Extractor
 * GPU-accelerated, performant animations
 */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

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

/* Slide In from Bottom */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* Pulse (GPU-accelerated with transform/opacity only) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Glow (GPU-accelerated with opacity only) */
@keyframes glow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Shimmer Loading - GPU accelerated */
@keyframes shimmer {
    0% {
        opacity: 0.4;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.4;
        transform: translateX(100%);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    animation: ripple 0.6s ease-out;
    will-change: transform, opacity;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                opacity 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    will-change: transform, opacity;
}

.toast-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toast Positions */
.toast-top-right {
    top: 2rem;
    right: 2rem;
}

.toast-top-left {
    top: 2rem;
    left: 2rem;
}

.toast-bottom-right {
    bottom: 2rem;
    right: 2rem;
}

.toast-bottom-left {
    bottom: 2rem;
    left: 2rem;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid var(--accent-green);
}

.toast-success i {
    color: var(--accent-green);
}

.toast-error {
    border-left: 4px solid var(--accent-red);
}

.toast-error i {
    color: var(--accent-red);
}

.toast-info {
    border-left: 4px solid var(--accent-blue);
}

.toast-info i {
    color: var(--accent-blue);
}

.toast-warning {
    border-left: 4px solid #ffcc00;
}

.toast-warning i {
    color: #ffcc00;
}

/* ============================================
   SHIMMER LOADING
   ============================================ */

.shimmer-loading {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.shimmer-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--bg-secondary) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite linear;
    will-change: transform, opacity;
}

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

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

/* ============================================
   BUTTON HOVER EFFECTS
   ============================================ */

.btn-hover-lift {
    transition: transform 0.2s ease;
    will-change: transform;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
}

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

.btn-hover-glow {
    position: relative;
    transition: opacity 0.3s ease;
}

.btn-hover-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 113, 227, 0.6);
}

.btn-hover-glow:hover::before {
    opacity: 1;
}

/* ============================================
   CARD ANIMATIONS
   ============================================ */

.card-animate-in {
    animation: fadeIn 0.5s ease-out;
}

.card-hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.card-hover-lift:hover {
    transform: translateY(-4px);
}

/* ============================================
   ICON ANIMATIONS
   ============================================ */

.icon-hover-rotate {
    transition: transform 0.3s ease;
    will-change: transform;
}

.icon-hover-rotate:hover {
    transform: rotate(15deg);
}

.icon-hover-scale {
    transition: transform 0.2s ease;
    will-change: transform;
}

.icon-hover-scale:hover {
    transform: scale(1.2);
}

.icon-spin {
    animation: rotate 1s linear infinite;
}

/* ============================================
   PROGRESS RINGS
   ============================================ */

.progress-ring {
    transform: rotate(-90deg);
    will-change: stroke-dashoffset;
}

.progress-ring-circle {
    stroke-linecap: round;
    /* No transition - set via JavaScript with opacity animation */
}

/* ============================================
   STAGGER ANIMATIONS
   ============================================ */

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item-visible {
    animation: slideInUp 0.5s ease-out forwards;
}

/* ============================================
   DRAG & DROP ENHANCEMENTS
   ============================================ */

.drag-over {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1), rgba(48, 209, 88, 0.1));
    transform: scale(1.02);
    opacity: 0.95;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.drag-active {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU Acceleration */
.gpu-accelerate {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 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;
        scroll-behavior: auto !important;
    }
    
    /* Disable transform animations */
    .btn:hover,
    .btn-hover-lift:hover,
    .card-hover-lift:hover {
        transform: none !important;
    }
    
    /* Keep only opacity transitions for minimal feedback */
    .btn:hover {
        opacity: 0.9;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

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

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

.animate-bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

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

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

.animate-shake {
    animation: shake 0.5s ease-in-out;
}
