/* ====================================
   🎯 REAL-TIME FEATURES & FINAL POLISH
   Phase 6 Enhancement
   ==================================== */

/* Live Update Indicators */
@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--universe-green);
    animation: pulse-dot 2s infinite;
    margin-right: 0.5rem;
}

.dark .live-indicator {
    background: var(--universe-cyan);
    box-shadow: 0 0 10px var(--universe-cyan);
}

/* Real-time Stats Animation */
@keyframes number-update {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(-10px);
        opacity: 0;
    }

    51% {
        transform: translateY(10px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.stat-updating {
    animation: number-update 0.5s ease-out;
}

/* Enhanced Notification System */
.fi-notification-modern {
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--universe-cyan);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.dark .fi-notification-modern {
    background: rgba(26, 26, 46, 0.95);
    border-left-color: var(--universe-cyan);
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.2);
}

html:not(.dark) .fi-notification-modern {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 40px rgba(0, 184, 212, 0.2);
}

/* Activity Pulse */
@keyframes activity-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 229, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    }
}

.activity-indicator {
    position: relative;
}

.activity-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--universe-cyan);
    animation: activity-pulse 2s infinite;
}

/* WebSocket Connection Status */
.connection-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 100;
    transition: all 0.3s;
}

.connection-status.connected {
    background: rgba(16, 185, 129, 0.2);
    color: var(--universe-green);
    border: 1px solid var(--universe-green);
}

.connection-status.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.connection-status.connecting {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

/* Live Data Update Flash */
@keyframes flash-update {

    0%,
    100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(0, 229, 255, 0.1);
    }
}

.data-updated {
    animation: flash-update 0.5s ease-out;
}

/* Enhanced Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-item {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--universe-cyan);
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.dark .toast-item {
    background: var(--universe-darker-blue);
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.2);
}

/* Success/Error States */
.toast-item.success {
    border-left-color: var(--universe-green);
}

.toast-item.error {
    border-left-color: #ef4444;
}

.toast-item.warning {
    border-left-color: #fbbf24;
}

/* Loading Skeleton */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.25rem;
}

.dark .skeleton {
    background: linear-gradient(90deg,
            var(--universe-darker-blue) 25%,
            rgba(0, 229, 255, 0.1) 50%,
            var(--universe-darker-blue) 75%);
}

/* Empty State Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

/* Progress Indicator */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
.fi-btn:focus-visible,
.fi-sidebar-item-button:focus-visible {
    outline: 2px solid var(--universe-cyan);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {

    .fi-section,
    .fi-card {
        border-width: 2px !important;
    }

    .fi-btn {
        border: 2px solid currentColor !important;
    }
}

/* Final Polish - Smooth Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 184, 212, 0.3);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 184, 212, 0.5);
    background-clip: padding-box;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
    background-clip: padding-box;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
    background-clip: padding-box;
}

/* Tooltip Enhancements */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--universe-almost-black);
    color: white;
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}