/**
 * Common Loading Animations and States
 *
 * Shared loading styles for consistent animations across the entire application.
 * Supports both individual block loading and full-page loading states.
 * Includes FODC (Flash of Default Content) prevention system.
 */

/* ============================================================================
   FODC (FLASH OF DEFAULT CONTENT) PREVENTION SYSTEM
   ============================================================================ */

/*
 * CSS-first loading state system to prevent Flash of Default Content.
 * Content sections are hidden by default and only shown after JavaScript loads.
 * Loading sections are visible by default until JavaScript takes control.
 */

/* CRITICAL: Ultra-high specificity rules to override Tailwind and inline styles */
/* Hide content sections by default - prevent all flash during load */
body html .js-content-section,
body.js-ready .js-content-section {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Show loading sections by default with ultra-high specificity */
body html .js-loading-section,
body.js-ready .js-loading-section {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Content shows only when .loaded class is explicitly added by JavaScript */
body.js-ready .js-content-section.loaded {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease-in-out;
}

/* Hide loading sections when content is loaded */
body.js-ready .js-loading-section.loaded {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Special override for when loading is explicitly shown by JavaScript during updates */
body.js-ready .js-loading-section.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Remove content when loading is shown */
body.js-ready .js-content-section.loading {
    display: none !important;
    visibility: hidden !important;
}

/* Fallback for users with JavaScript disabled */
.no-js .js-content-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.no-js .js-loading-section {
    display: none !important;
    visibility: hidden !important;
}

/* Special handling for block loading containers - enhance existing styles */
.block-loading-container.js-loading-section {
    /* Inherit all existing block loading container styles */
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    transition: opacity 0.2s ease-in-out;
}

.dark .block-loading-container.js-loading-section {
    background: rgba(35, 38, 47, 0.9);
}

/* ============================================================================
   SHARED LOADING CONTAINERS AND ANIMATIONS
   ============================================================================ */

/* Base loading container styling */
.loading-container {
    text-align: center;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

/* Content fade-in transition */
.content-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced loading animations */
@keyframes pulse-loading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes progress-bar {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

.loading-pulse {
    animation: pulse-loading 1.5s ease-in-out infinite;
}

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

/* ============================================================================
   BACKGROUND UPDATE INDICATORS
   ============================================================================ */

/* Background update indicator */
.bg-update-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    transform: translateX(-100%);
    animation: slide-progress 2s ease-in-out infinite;
    border-radius: 0 0 2px 2px;
    z-index: 5;
}

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

.bg-update-pulse {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
    z-index: 5;
}

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

/* ============================================================================
   SPINNER ANIMATIONS
   ============================================================================ */

/* Loading spinner for individual blocks */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 3px;
}

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

/* ============================================================================
   BLOCK-BASED LOADING SYSTEM
   ============================================================================ */

/* Block loading containers */
.block-loading-container {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    transition: opacity 0.2s ease-in-out;
}

.dark .block-loading-container {
    background: rgba(35, 38, 47, 0.9);
}

.block-loading-container.show {
    display: flex;
}

/* Block loading content */
.block-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
}

.block-loading-text {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.dark .block-loading-text {
    color: #9ca3af;
}

/* ============================================================================
   SYSTEM STATUS LOADING STATES
   ============================================================================ */

/* System status loading indicators */
.status-loading {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================================================
   CONFIGURATION FORM LOADING
   ============================================================================ */

/* Form loading overlay */
.form-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(1px);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

.dark .form-loading-overlay {
    background: rgba(35, 38, 47, 0.8);
}

/* ============================================================================
   ALERTS LOADING STATES
   ============================================================================ */

/* Alert list skeleton loading */
.alert-skeleton {
    height: 3rem;
    background: linear-gradient(
        90deg,
        #f3f4f6 25%,
        #e5e7eb 50%,
        #f3f4f6 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.dark .alert-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;
    }
}

/* ============================================================================
   SCHEDULED TRADES SCANNING STATE
   ============================================================================ */

/* Scanning container layout */
.scanning-container {
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.scanning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 280px;
}

/* Scanning text styles */
.scanning-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.scanning-primary {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.scanning-secondary {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

.dark .scanning-primary {
    color: #e5e7eb;
}

.dark .scanning-secondary {
    color: #9ca3af;
}

/* Scanning progress bar */
.scanning-progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

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

.scanning-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #3b82f6);
    background-size: 200% 100%;
    animation: progress-sweep 4s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes progress-sweep {
    0% {
        width: 0%;
        background-position: 200% 0;
    }
    50% {
        width: 70%;
        background-position: 0% 0;
    }
    100% {
        width: 100%;
        background-position: -200% 0;
    }
}

/* Scanning state FODC integration */
.js-scanning-section {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

body.js-ready .js-scanning-section.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease-in-out;
}

/* ============================================================================
   RESPONSIVE LOADING STATES
   ============================================================================ */

/* Mobile-specific loading adjustments */
@media (max-width: 640px) {
    .loading-container {
        padding: 0.75rem;
        min-height: 80px;
    }

    .loading-spinner {
        width: 1.5rem;
        height: 1.5rem;
    }

    .loading-spinner-lg {
        width: 2.5rem;
        height: 2.5rem;
    }

    .block-loading-content {
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .block-loading-text {
        font-size: 0.75rem;
    }

    /* Mobile scanning state adjustments */
    .scanning-container {
        padding: 1.5rem 0.75rem;
        min-height: 120px;
    }

    .scanning-content {
        gap: 0.75rem;
        max-width: 240px;
    }

    .scanning-primary {
        font-size: 0.8rem;
    }

    .scanning-secondary {
        font-size: 0.7rem;
    }
}

/* ============================================================================
   FUNDING RESET TIMER TRANSITIONS
   ============================================================================ */

/* Smooth transitions for funding reset timer updates to prevent flash */
.funding-reset-timer {
    transition: color 0.2s ease, background-color 0.2s ease;
    font-variant-numeric: tabular-nums; /* Consistent digit width */
    letter-spacing: 0.025em; /* Slightly increased spacing for readability */
}

/* Timer content updates - prevent layout shift during value changes */
.funding-reset-timer::before {
    content: attr(data-timer-value);
    display: inline-block;
    min-width: 4.5em; /* Reserve space for "XX:XX" format */
    text-align: center;
}

/* Timer state transitions for different urgency levels */
.funding-reset-timer.urgent {
    animation: timer-pulse 1s ease-in-out infinite alternate;
}

.funding-reset-timer.warning {
    color: #f59e0b;
    transition: color 0.3s ease;
}

.funding-reset-timer.critical {
    color: #ef4444;
    font-weight: 600;
    animation: timer-flash 0.5s ease-in-out infinite alternate;
}

/* Timer pulse animation for urgent states */
@keyframes timer-pulse {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Timer flash animation for critical states */
@keyframes timer-flash {
    from {
        background-color: transparent;
    }
    to {
        background-color: rgba(239, 68, 68, 0.1);
    }
}

/* Smooth table cell updates to prevent DOM flash */
.rates-table td {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Funding rate cell transitions */
.funding-rate-cell {
    transition: all 0.2s ease;
    font-variant-numeric: tabular-nums;
}

/* Symbol link transitions */
.symbol-link {
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

/* Dark mode timer transitions */
.dark .funding-reset-timer.warning {
    color: #fbbf24;
}

.dark .funding-reset-timer.critical {
    color: #f87171;
}

.dark .funding-reset-timer.critical {
    animation: timer-flash-dark 0.5s ease-in-out infinite alternate;
}

@keyframes timer-flash-dark {
    from {
        background-color: transparent;
    }
    to {
        background-color: rgba(248, 113, 113, 0.15);
    }
}

/* ============================================================================
   PRECISION INTEGRATION LOADING STATES
   ============================================================================ */

/* Precision loading state for element enhancement */
.precision-loading {
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
    position: relative;
}

/* Precision enhanced state */
.precision-enhanced {
    opacity: 1.0;
    transition: opacity 0.2s ease-in-out;
}

/* Subtle precision loading shimmer effect */
.precision-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: precision-shimmer 1.5s ease-in-out infinite;
    border-radius: 3px;
}

.dark .precision-skeleton {
    background: linear-gradient(90deg, #374151 25%, transparent 37%, #374151 63%);
    background-size: 400% 100%;
}

/* Precision shimmer animation */
@keyframes precision-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Precision error state - subtle red tint for very brief error indication */
.precision-error {
    background-color: rgba(239, 68, 68, 0.1);
    transition: background-color 0.3s ease;
}

.dark .precision-error {
    background-color: rgba(248, 113, 113, 0.15);
}

/* Price enhancement loading indicator for individual elements */
.price-enhancing::after {
    content: '';
    position: absolute;
    top: 0;
    right: -4px;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, transparent, #3b82f6, transparent);
    animation: precision-pulse 1s ease-in-out infinite;
    border-radius: 1px;
    opacity: 0.6;
}

@keyframes precision-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scaleY(1.2);
    }
}

/* Batch processing indicator for bulk precision loading */
.precision-batch-loading {
    position: relative;
    overflow: hidden;
}

.precision-batch-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    animation: batch-progress 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes batch-progress {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Preload indicator for cache warming */
.precision-preloading {
    position: relative;
}

.precision-preloading::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: preload-pulse 2s ease-in-out infinite;
    opacity: 0.7;
    z-index: 1;
}

@keyframes preload-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.3);
    }
}

/* Precision enhancement success indicator - very brief green flash */
.precision-success {
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
    transition: box-shadow 0.2s ease;
}

/* Table cell precision loading states */
.funding-rate-cell.precision-loading,
.symbol-price-display.precision-loading {
    background: linear-gradient(90deg,
        rgba(59, 130, 246, 0.05),
        rgba(59, 130, 246, 0.1),
        rgba(59, 130, 246, 0.05)
    );
    background-size: 200% 100%;
    animation: table-cell-shimmer 1.8s ease-in-out infinite;
}

.dark .funding-rate-cell.precision-loading,
.dark .symbol-price-display.precision-loading {
    background: linear-gradient(90deg,
        rgba(59, 130, 246, 0.08),
        rgba(59, 130, 246, 0.15),
        rgba(59, 130, 246, 0.08)
    );
    background-size: 200% 100%;
}

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

/* ============================================================================
   ACCESSIBILITY AND MOTION PREFERENCES
   ============================================================================ */

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner,
    .bg-update-indicator,
    .bg-update-pulse,
    .content-fade-in,
    .loading-pulse,
    .progress-bar-animate,
    .alert-skeleton,
    .status-loading::after,
    .scanning-progress-fill,
    .funding-reset-timer.urgent,
    .funding-reset-timer.critical,
    .precision-skeleton,
    .price-enhancing::after,
    .precision-batch-loading::before,
    .precision-preloading::after,
    .funding-rate-cell.precision-loading,
    .symbol-price-display.precision-loading {
        animation: none;
    }

    .content-fade-in {
        opacity: 1;
        transform: none;
    }

    .bg-update-indicator,
    .bg-update-pulse {
        display: none;
    }

    /* Remove transitions for FODC prevention system */
    .js-content-section {
        transition: none;
    }

    /* Ensure immediate visibility for reduced motion users */
    .js-ready .js-content-section {
        opacity: 1;
        transform: none;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .loading-spinner {
        border-top-color: #000;
    }

    .dark .loading-spinner {
        border-top-color: #fff;
    }

    .block-loading-container {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #000;
    }

    .dark .block-loading-container {
        background: rgba(0, 0, 0, 0.95);
        border: 1px solid #fff;
    }
}

/* ============================================================================
   ADVANCED PRECISION PERFORMANCE OPTIMIZATION STATES
   ============================================================================ */

/* Performance optimization processing indicators */
.precision-optimizing {
    position: relative;
    overflow: hidden;
}

.precision-optimizing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, #3b82f6, transparent);
    animation: optimization-progress 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes optimization-progress {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Bulk operation indicator */
.bulk-precision-processing {
    position: relative;
}

.bulk-precision-processing::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: bulk-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
}

@keyframes bulk-pulse {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3);
    }
    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Cache hit indicator - very subtle green glow */
.precision-cache-hit {
    box-shadow: 0 0 2px rgba(16, 185, 129, 0.4);
    transition: box-shadow 0.2s ease;
}

/* Cache miss indicator - very subtle orange glow */
.precision-cache-miss {
    box-shadow: 0 0 2px rgba(245, 158, 11, 0.3);
    transition: box-shadow 0.2s ease;
}

/* Performance grade indicators */
.precision-performance-excellent::before {
    content: '⚡';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #10b981;
    z-index: 1;
}

.precision-performance-good::before {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #059669;
    z-index: 1;
}

.precision-performance-slow::before {
    content: '⚠';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    color: #f59e0b;
    z-index: 1;
}

/* Memory optimization indicator */
.precision-memory-optimized {
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.05) 50%, transparent 100%);
    transition: background 0.3s ease;
}

/* Smart prefetch success indicator */
.precision-prefetch-success {
    position: relative;
}

.precision-prefetch-success::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #10b981;
    border-radius: 50%;
    animation: prefetch-success-fade 2s ease-out;
}

@keyframes prefetch-success-fade {
    0% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(1.5);
    }
}

/* Batch processing progress bar */
.precision-batch-progress {
    position: relative;
    overflow: hidden;
}

.precision-batch-progress::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    animation: batch-progress-fill var(--batch-duration, 2s) ease-out forwards;
}

@keyframes batch-progress-fill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* High performance mode indicator */
.precision-high-performance {
    position: relative;
}

.precision-high-performance::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: inherit;
    animation: high-performance-glow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes high-performance-glow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* System optimization indicator for body */
body.precision-system-optimized {
    position: relative;
}

body.precision-system-optimized::before {
    content: '';
    position: fixed;
    top: 0;
    right: 20px;
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, transparent, #10b981, transparent);
    animation: system-optimization-indicator 4s ease-in-out infinite;
    z-index: 1000;
    border-radius: 2px;
}

@keyframes system-optimization-indicator {
    0%, 100% {
        opacity: 0.4;
        transform: scaleY(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scaleY(1.2);
    }
}

/* ============================================================================
   PERFORMANCE METRICS DISPLAY
   ============================================================================ */

/* Performance metrics overlay (for debugging) */
.precision-metrics-overlay {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    z-index: 2000;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.precision-metrics-overlay.show {
    opacity: 1;
    transform: translateX(0);
}

.precision-metrics-overlay .metric-line {
    display: block;
    margin: 2px 0;
}

.precision-metrics-overlay .metric-good {
    color: #10b981;
}

.precision-metrics-overlay .metric-warning {
    color: #f59e0b;
}

.precision-metrics-overlay .metric-error {
    color: #ef4444;
}

/* ============================================================================
   REDUCED MOTION SUPPORT FOR PERFORMANCE INDICATORS
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    .precision-optimizing::before,
    .bulk-precision-processing::after,
    .precision-batch-progress::before,
    .precision-high-performance::before,
    body.precision-system-optimized::before,
    .precision-prefetch-success::after {
        animation: none;
        display: none;
    }

    .precision-cache-hit,
    .precision-cache-miss,
    .precision-memory-optimized,
    .precision-metrics-overlay {
        transition: none;
    }

    /* Static indicators for reduced motion users */
    .precision-optimizing {
        border-top: 2px solid #10b981;
    }

    .bulk-precision-processing {
        border-right: 2px solid #3b82f6;
    }
}

/* ============================================================================
   HIGH CONTRAST SUPPORT FOR PERFORMANCE INDICATORS
   ============================================================================ */

@media (prefers-contrast: high) {
    .precision-cache-hit {
        box-shadow: 0 0 0 1px #059669;
    }

    .precision-cache-miss {
        box-shadow: 0 0 0 1px #d97706;
    }

    .precision-metrics-overlay {
        background: #000;
        border: 1px solid #fff;
    }

    .precision-performance-excellent::before,
    .precision-performance-good::before,
    .precision-performance-slow::before {
        font-weight: bold;
        text-shadow: 0 0 1px currentColor;
    }
}
