/* Modern Animations and Micro-interactions for Manie Pro */

/* Ripple Effect for Buttons */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

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

/* Enhanced Pulse Animation */
@keyframes pulseEnhanced {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

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

/* Slide In Up Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In Down Animation */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Flip In Animation */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

/* Glow Effect */
.glow-effect {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    transform: translateY(-5px) scale(1.02);
    transition: all 0.3s ease;
}

/* Success Checkmark Animation */
.success-checkmark-modern {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fillSuccess 0.4s ease-in-out 0.4s forwards, scaleSuccess 0.3s ease-in-out 0.9s both;
    margin: 0 auto;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin: 10% auto;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

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

@keyframes fillSuccess {
    100% {
        box-shadow: inset 0px 0px 0px 40px #10b981;
    }
}

@keyframes scaleSuccess {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

/* Enhanced Loading Spinner */
.loading-spinner-modern {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
    margin: 20px auto;
}

.loading-spinner-modern::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid transparent;
    border-top: 2px solid #9d4edd;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Spinner Inner Animation */
.spinner-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00d4ff, #9d4edd);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseSpinner 2s ease-in-out infinite;
}

@keyframes pulseSpinner {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.7;
    }
}

/* Enhanced Progress Bar Animation */
.progress-bar-modern {
    position: relative;
    overflow: hidden;
}

.progress-bar-modern::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: progressShineModern 2s linear infinite;
}

@keyframes progressShineModern {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced Card Hover Effects */
.card-hover-effect {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.8s ease;
}

.card-hover-effect:hover::before {
    left: 100%;
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.3);
}

/* Enhanced Button Hover Effects */
.btn-modern-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-modern-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-modern-enhanced:hover::before {
    left: 100%;
}

.btn-modern-enhanced:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-modern-enhanced:active {
    transform: translateY(-1px);
}

/* Enhanced Micro Bounce */
.micro-bounce {
    animation: microBounce 0.3s ease;
}

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

/* Enhanced Text Animation */
.text-animation {
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.6);
    }
}

/* Enhanced Number Counter Animation */
.counter-animation {
    font-family: 'Cairo', monospace;
    font-weight: 600;
}

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

/* Enhanced Modal Animation */
.modal-animation {
    animation: modalFadeIn 0.4s ease-out;
}

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

/* Enhanced Notification Animation */
.notification-animation {
    animation: slideInRight 0.5s ease-out;
}

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

/* Enhanced Drag and Drop Animation */
.drag-over-animation {
    animation: dragOverPulse 1s ease infinite;
}

@keyframes dragOverPulse {
    0%, 100% {
        transform: scale(1);
        border-color: #ff006e;
    }
    50% {
        transform: scale(1.02);
        border-color: #ff3388;
        box-shadow: 0 0 30px rgba(255, 0, 110, 0.5);
    }
}

/* Enhanced File Card Animation */
.file-card-animation {
    animation: fileCardAppear 0.6s ease-out;
}

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

/* Enhanced Table Row Animation */
.table-row-animation {
    animation: tableRowSlideIn 0.4s ease-out;
}

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

/* Enhanced Accordion Animation */
.accordion-animation {
    animation: accordionSlide 0.4s ease-out;
}

@keyframes accordionSlide {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

/* Enhanced Gradient Animation */
.gradient-animation {
    background: linear-gradient(45deg, #667eea, #764ba2, #9d4edd, #ff006e);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Enhanced Shine Effect */
.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Enhanced Neon Effect */
.neon-effect {
    text-shadow: 
        0 0 5px #00d4ff,
        0 0 10px #00d4ff,
        0 0 15px #00d4ff,
        0 0 20px #00d4ff;
    animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px #00d4ff,
            0 0 10px #00d4ff,
            0 0 15px #00d4ff,
            0 0 20px #00d4ff;
    }
    50% {
        text-shadow: 
            0 0 2px #00d4ff,
            0 0 5px #00d4ff,
            0 0 8px #00d4ff,
            0 0 12px #00d4ff;
    }
}

/* Enhanced Hover Glow Effect */
.hover-glow-enhanced {
    transition: all 0.3s ease;
}

.hover-glow-enhanced:hover {
    box-shadow: 
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

/* Enhanced Pulse Ring Effect */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #00d4ff;
    border-radius: 50%;
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Enhanced Stagger Animation */
.stagger-animation {
    animation: staggerIn 0.8s ease-out;
}

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

/* Enhanced Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 0.15em solid #00d4ff;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #00d4ff;
    }
}

/* Enhanced Particle Animation */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00d4ff;
    border-radius: 50%;
    animation: particleFloat 4s infinite;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

/* Enhanced Loading Dots Animation */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: loadingDots 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 loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced File Card Processing State */
.file-card-modern.processing {
    position: relative;
    overflow: hidden;
}

.file-card-modern.processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: processingSlide 2s infinite;
}

@keyframes processingSlide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced Success Icon Animation */
.success-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successIconAppear 0.5s ease-out;
    z-index: 10;
}

.success-icon i {
    color: white;
    font-size: 16px;
    animation: successIconCheck 0.8s ease-out;
}

@keyframes successIconAppear {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes successIconCheck {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Enhanced Error Icon Animation */
.error-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: errorIconAppear 0.5s ease-out;
    z-index: 10;
}

.error-icon i {
    color: white;
    font-size: 16px;
    animation: errorIconShake 0.8s ease-out;
}

@keyframes errorIconAppear {
    from {
        transform: translate(-50%, -50%) scale(0) rotate(180deg);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes errorIconShake {
    0%, 100% {
        transform: translateX(0);
    }
    25%, 75% {
        transform: translateX(-2px);
    }
    50% {
        transform: translateX(2px);
    }
}

/* Enhanced File Loading Animation */
.file-loading-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border-radius: inherit;
}

/* Enhanced Batch Processing Progress */
.batch-progress-modern {
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.9), rgba(50, 50, 80, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.batch-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.batch-progress-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.batch-progress-status {
    font-size: 0.9rem;
    color: var(--gray-400);
}

.batch-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.batch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.8s ease;
    position: relative;
}

.batch-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: batchProgressShine 2s linear infinite;
}

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

/* Enhanced File Processing States */
.file-processing-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    margin: 5px 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.file-processing-state.processing {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.1));
    color: var(--accent-blue);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.file-processing-state.completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.file-processing-state.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Enhanced Processing Queue Animation */
.processing-queue-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.queue-item {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-300);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.queue-item.processing {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border-color: var(--accent-blue);
    animation: queueItemProcessing 2s ease infinite;
}

@keyframes queueItemProcessing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }
}

.queue-item.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.4);
}

.queue-item.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Enhanced Responsive Animations */
@media (max-width: 768px) {
    .loading-spinner-modern {
        width: 40px;
        height: 40px;
    }
    
    .success-checkmark-modern {
        width: 60px;
        height: 60px;
    }
    
    .neon-effect {
        font-size: 1.5rem;
    }
}

/* Enhanced Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-all {
    will-change: all;
}

.transform-gpu {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.preserve-3d {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass-card-modern {
        border: 2px solid #ffffff;
    }
    
    .btn-modern {
        border: 2px solid #ffffff;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --accent-blue: #00aaff;
        --accent-purple: #bb6ff0;
        --accent-pink: #ff4d9e;
    }
}