/* =========================================================
   PREMIUM LOADING STYLES FOR DASHBOARD (MAPS, GRAPHS & STATS)
   Used across public, CDC, and Service dashboards
   ========================================================= */

/* --- Skeleton Shimmer for Stat Numbers & Metric Cards --- */
.skeleton-shimmer-pill {
    display: inline-block;
    width: 72px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: shimmer-pill 1.6s ease-in-out infinite;
    vertical-align: middle;
}

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

/* --- Graph Loading Overlay & Waveform --- */
.graph-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 380px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.graph-loading-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(226, 232, 240, 0.45) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(226, 232, 240, 0.45) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, transparent 75%);
    opacity: 0.75;
}

.graph-loading-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 20px;
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 320px;
    text-align: center;
    animation: card-pop-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-pop-in {
    0% { transform: scale(0.94); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.graph-wave-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    margin-bottom: 14px;
}

.graph-wave-bars .bar {
    width: 6px;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(180deg, #3b82f6 0%, #06b6d4 100%);
    animation: wave-scale 1.2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.graph-wave-bars .bar-1 { animation-delay: 0.0s; }
.graph-wave-bars .bar-2 { animation-delay: 0.15s; }
.graph-wave-bars .bar-3 { animation-delay: 0.3s; height: 22px; }
.graph-wave-bars .bar-4 { animation-delay: 0.45s; }
.graph-wave-bars .bar-5 { animation-delay: 0.6s; }

@keyframes wave-scale {
    0%, 100% {
        height: 12px;
        transform: scaleY(1);
        opacity: 0.65;
    }
    50% {
        height: 38px;
        transform: scaleY(1.3);
        opacity: 1;
    }
}

.graph-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.graph-loading-subtext {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 14px;
}

/* --- Indeterminate Progress Line --- */
.loading-progress-bar {
    width: 140px;
    height: 4px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.loading-progress-line {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 999px;
    animation: progress-slide 1.4s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { left: -50%; width: 30%; }
    50% { width: 60%; }
    100% { left: 100%; width: 40%; }
}

/* --- Map Loading Overlay --- */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.map-loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.map-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 32px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    box-shadow: 0 14px 36px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.7);
    text-align: center;
    animation: card-pop-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-pulse-ring-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.map-pulse-ripple {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(59, 130, 246, 0.05) 70%, transparent 100%);
    animation: pulse-ripple 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes pulse-ripple {
    0% { transform: scale(0.7); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1.4); opacity: 0; }
}

.map-spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(226, 232, 240, 0.6);
    border-top-color: #0284c7;
    border-right-color: #38bdf8;
    animation: ring-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.map-loading-icon {
    position: relative;
    z-index: 3;
    font-size: 24px;
    color: #0284c7;
    animation: float-icon 2s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.map-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 3px;
}

.map-loading-subtext {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}
