/**
 * Skeleton Loader Styles
 * Provides loading states for dashboard components
 */

/* Base skeleton animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Skeleton card for KPIs */
.skeleton-kpi-card {
    height: 120px;
    border-radius: 0.5rem;
}

/* Skeleton for chart */
.skeleton-chart {
    height: 256px;
    border-radius: 0.5rem;
}

/* Skeleton for table row */
.skeleton-table-row {
    height: 48px;
    margin-bottom: 8px;
}

/* Skeleton text lines */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.large {
    height: 32px;
}

.skeleton-text.medium {
    height: 24px;
}

.skeleton-text.small {
    height: 12px;
}

/* Progress bar container - full screen overlay */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.dark .progress-container {
    background: rgba(31, 41, 55, 0.98);
}

.progress-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
    padding: 32px;
}

.progress-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    animation: pulse-logo 2s ease-in-out infinite;
}

@keyframes pulse-logo {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.progress-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

.dark .progress-title {
    color: #f3f4f6;
}

.progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 24px 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dark .progress-bar-wrapper {
    background: #374151;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    position: relative;
    overflow: hidden;
}

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

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

.progress-status {
    color: #6b7280;
    font-size: 14px;
    margin-top: 12px;
    min-height: 20px;
    font-weight: 500;
}

.dark .progress-status {
    color: #9ca3af;
}

.progress-percentage {
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.dark .progress-percentage {
    color: #f3f4f6;
}

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

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

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

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

/* Spinner for tables and sections */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.dark .loading-spinner {
    border-color: #374151;
    border-top-color: #10b981;
}

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

/* Loading container for centered spinner */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.loading-container.small {
    padding: 24px 0;
}

/* Skeleton pulsing effect for cards */
.skeleton-pulse {
    animation: skeleton-pulse 2s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
