/* ==================== Skeleton Loading Animations ==================== */

/* Base shimmer animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Pulse animation for live indicators */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

/* Fade in animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Slide in from right (RTL) */
@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* Count up animation */
@keyframes countUp {
    from { opacity: 0.5; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==================== Skeleton Classes ==================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-dark {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
}

/* Skeleton variations */
.skeleton-text {
    height: 16px;
    width: 80%;
    margin-bottom: 8px;
}

.skeleton-text-sm {
    height: 12px;
    width: 60%;
}

.skeleton-text-lg {
    height: 24px;
    width: 40%;
}

.skeleton-stat {
    height: 32px;
    width: 60px;
    display: inline-block;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.skeleton-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 8px;
}

.skeleton-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

/* Skeleton row pattern */
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 10px;
}

.skeleton-row .skeleton-content {
    flex: 1;
}

/* ==================== Animation Classes ==================== */

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.3s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.count-up {
    animation: countUp 0.3s ease;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ==================== Live Indicator ==================== */

.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.live-dot-amber {
    background: #f59e0b;
}

.live-dot-red {
    background: #ef4444;
}

/* ==================== Loading Overlay ==================== */

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Progress Bar ==================== */

.progress-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Indeterminate progress */
.progress-bar-indeterminate .progress-bar-fill {
    width: 30%;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ==================== Transitions ==================== */

.transition-smooth {
    transition: all 0.3s ease;
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================== Empty States ==================== */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state-icon svg {
    width: 32px;
    height: 32px;
    color: #9ca3af;
}

/* ==================== Success Animation ==================== */

@keyframes success-check {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.success-animation {
    animation: success-check 0.4s ease forwards;
}
