/* Critical first-paint skeleton loaders */

.loading-skeleton {
    color: transparent !important;
}

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

.stat-value.loading,
.stat-value > .loading {
    display: inline-grid !important;
    gap: 0.34rem;
    min-width: 7.2rem;
    overflow: hidden;
    color: transparent !important;
    font-size: 0 !important;
    text-shadow: none !important;
}

.stat-value.loading::before,
.stat-value > .loading::before {
    content: '';
    width: 7rem;
    height: 1.55rem;
    background: linear-gradient(
        90deg,
        var(--glass-bg) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--glass-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 6px;
}

.stat-value.loading::after,
.stat-value > .loading::after {
    content: attr(data-loading-copy);
    color: var(--text-tertiary);
    font-size: 0.68rem;
    letter-spacing: 0;
}

.stat-value.loading:not([data-loading-copy])::after,
.stat-value > .loading:not([data-loading-copy])::after {
    content: 'Preheating the oven';
}

.stat-card:has(.loading) {
    background-image: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.09), transparent);
    background-size: 240% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .stat-value.loading::before,
    .stat-value > .loading::before,
    .stat-card:has(.loading) {
        animation: none;
    }
}

[data-theme="clean"] .stat-value.loading::before,
[data-theme="clean"] .stat-value > .loading::before {
    background: linear-gradient(90deg, #f0f1f3 25%, #e0e2e6 50%, #f0f1f3 75%);
    background-size: 200% 100%;
}

.hero-arrival-pending .top-continuity-stat strong {
    min-width: 2.8rem;
    border-radius: 5px;
    color: transparent !important;
    background: linear-gradient(
        90deg,
        var(--glass-bg) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        var(--glass-bg) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .hero-arrival-pending .top-continuity-stat strong {
        animation: none;
    }
}
