/**
 * WIKK - MegaETH Real-Time Dashboard
 * Custom Styles
 */

/* ============================================================================
   BASE STYLES
   ============================================================================ */

* {
    scrollbar-width: thin;
    scrollbar-color: #696767 transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

*::-webkit-scrollbar-thumb {
    background-color: #696767;
    border-radius: 3px;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */

#loading-screen {
    transition: opacity 0.5s ease-out;
}

/* ============================================================================
   METRIC CARDS
   ============================================================================ */

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ECE8E8, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover::before {
    opacity: 0.5;
}

.metric-card.pulse-update {
    animation: cardPulse 0.3s ease-out;
}

@keyframes cardPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(236, 232, 232, 0.2);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(236, 232, 232, 0);
    }
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */

.tooltip-container {
    position: relative;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
    pointer-events: none;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.dark .tooltip {
    background: #0f172a;
    border: 1px solid #334155;
}

.dark .tooltip::after {
    border-top-color: #0f172a;
}

/* ============================================================================
   CHARTS
   ============================================================================ */

canvas {
    max-width: 100%;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

button:focus-visible {
    outline: 2px solid #ECE8E8;
    outline-offset: 2px;
}

.time-range-btn.active {
    background: rgba(236, 232, 232, 0.1);
    color: #ECE8E8;
    border-color: rgba(236, 232, 232, 0.4);
}

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

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

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Number counter animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.3s ease-out;
}

/* Glow effect for live indicator */
@keyframes liveGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(34, 197, 94, 0.7);
    }
}

.live-glow {
    animation: liveGlow 2s ease-in-out infinite;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 640px) {
    .metric-card {
        padding: 1rem;
    }
    
    .metric-card .text-3xl {
        font-size: 1.5rem;
    }
    
    .metric-card .text-4xl {
        font-size: 1.75rem;
    }
}

/* ============================================================================
   DETAILS/SUMMARY (FAQ)
   ============================================================================ */

details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* ============================================================================
   SELECTION
   ============================================================================ */

::selection {
    background: rgba(236, 232, 232, 0.3);
    color: inherit;
}

::-moz-selection {
    background: rgba(236, 232, 232, 0.3);
    color: inherit;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .metric-card {
        border-width: 2px;
    }
    
    .tooltip {
        border: 2px solid #fff;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    #loading-screen,
    #share-btn,
    #toast,
    #error-modal,
    button {
        display: none !important;
    }
    
    body {
        background: #fff !important;
        color: #000 !important;
    }
    
    .metric-card {
        break-inside: avoid;
        border: 1px solid #000;
    }
}
