/* Modern UI Animations and Effects */

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

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

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

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

/* Glow Effect */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 25px rgba(59, 130, 246, 0.8), 0 0 50px rgba(59, 130, 246, 0.5); }
    100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
}

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

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

/* Rotate In */
@keyframes rotateIn {
    from { transform: rotate(-200deg) scale(0); opacity: 0; }
    to { transform: rotate(0) scale(1); opacity: 1; }
}

/* Number Counter Animation */
@keyframes countUp {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

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

.btn-modern::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;
}

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

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

.notification-toast.hide {
    animation: slideInRight 0.5s ease-out reverse;
}

/* Live Indicator */
.live-indicator {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.2); }
    100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 0 30px rgba(34, 197, 94, 0.4); }
}

/* Loading Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

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

.gradient-animate {
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* Stats Card Enhanced Effects */
.stats-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* New Order Highlight */
.new-order {
    animation: bounceIn 0.6s ease-out, glow 2s ease-in-out infinite alternate;
}

/* Update Animation for Numbers */
.number-update {
    animation: pulse 0.5s ease-in-out, countUp 0.8s ease-out;
}

/* Utility Classes */
.animate-fadeIn { animation: fadeIn 0.6s ease-out; }
.animate-bounceIn { animation: bounceIn 0.8s ease-out; }
.animate-scaleIn { animation: scaleIn 0.5s ease-out; }
.animate-rotateIn { animation: rotateIn 0.7s ease-out; }
.animate-slideInRight { animation: slideInRight 0.5s ease-out; }
.animate-shake { animation: shake 0.6s ease-in-out; }
.animate-glow { animation: glow 2s ease-in-out infinite alternate; }

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

/* Additional Modern UI Effects */

/* Platform card animations */
.platform-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.platform-card:hover {
    transform: translateY(-5px) scale(1.03);
}

/* Status badge animations */
.status-badge {
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Activity item animations */
.activity-item {
    transition: all 0.3s ease;
}

.activity-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Connection status animation */
.connection-status {
    animation: pulse-connection 2s ease-in-out infinite;
}

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

/* Counter number animation */
.sales-counter, .orders-counter {
    transition: all 0.3s ease;
    font-variant-numeric: tabular-nums;
}

/* Table row animations */
tr.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

tr:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

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

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Error states */
.error-shake {
    animation: shake 0.6s ease-in-out;
}

/* Success states */
.success-bounce {
    animation: bounceIn 0.6s ease-out;
}

/* Notification container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    margin-bottom: 10px;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInRight 0.3s ease-out;
}

.notification.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    color: white;
}

/* Particle effects */
.particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    animation: particle-float 3s linear forwards;
    z-index: 999;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-hover:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .platform-card:hover {
        transform: translateY(-3px) scale(1.02);
    }
}

/* Additional animation classes */
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-bounceIn {
    animation: bounceIn 0.6s ease-out;
}

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

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-rotateIn {
    animation: rotateIn 0.6s ease-out;
}

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

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

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

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

.animate-gradient {
    animation: gradient 15s ease infinite;
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
