/* uPlot dark theme overrides for AS-Stats */

/* Chart container */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 120px;
}

.chart-container.chart-loading {
    background: #161b22;
    border-radius: 4px;
    overflow: hidden;
}

.chart-container.chart-loading::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 25%, #1c212840 50%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

.chart-error {
    color: #f85149;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

/* uPlot overrides */
.uplot {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.u-over {
    cursor: crosshair !important;
}

.u-select {
    background: rgba(88, 166, 255, 0.15) !important;
    border: 1px solid rgba(88, 166, 255, 0.3) !important;
}

.u-legend {
    font-size: 12px;
    padding: 4px 8px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    margin-top: 4px;
    text-align: left;
}

.u-legend th {
    color: #8b949e;
    font-weight: normal;
    padding: 2px 6px;
}

.u-legend td {
    color: #e6edf3;
    padding: 2px 6px;
}

.u-legend .u-marker {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.u-legend .u-series:first-child {
    display: none;
}

/* Tooltip */
.uplot-tooltip {
    position: absolute;
    z-index: 10000;
    pointer-events: none;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-width: 350px;
    white-space: nowrap;
}

.uplot-tooltip-time {
    color: #8b949e;
    margin-bottom: 4px;
    font-size: 11px;
    border-bottom: 1px solid #30363d;
    padding-bottom: 4px;
}

.uplot-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e6edf3;
}

.uplot-tooltip-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.uplot-tooltip-label {
    flex: 1;
    color: #8b949e;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uplot-tooltip-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Thumbnail specific */
.chart-container[data-thumbnail] {
    min-height: 180px;
    cursor: pointer;
}

.chart-container[data-thumbnail] .uplot {
    pointer-events: none;
}

/* Detail chart heights */
.chart-container.chart-detail {
    min-height: 320px;
}

.chart-container.chart-link {
    min-height: 360px;
}

/* Reset zoom button */
.chart-reset-zoom {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    background: #30363d;
    color: #e6edf3;
    border: 1px solid #484f58;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
}

.chart-reset-zoom:hover {
    background: #484f58;
}
