html, body {
    font-family: 'Inter', 'Roboto', sans-serif;
}

#blazor-error-ui {
    background: #6e0101;
    color: white;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
    display: none;
    left: 0;
    padding: 0.8rem 1.2rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    text-align: center;
    font-size: 0.9rem;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 0.5rem;
    }

.loading-progress {
    width: 80px;
    height: 80px;
}

    .loading-progress circle {
        fill: none;
        stroke: #5568f2;
        stroke-width: 4px;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #374ef8;
            stroke-dasharray: calc(3.141 * 80%), 500%;
            transition: stroke-dasharray .3s;
        }

/* Metric Cards */
.metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 90px;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

/* Status Badges */
.status-badge-running {
    color: #4caf50;
    font-weight: 600;
}

.status-badge-stopped {
    color: #f44336;
    font-weight: 600;
}

/* Gauge */
.gauge-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.gauge-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* Section Titles */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.87);
}

/* Table Overflow */
.mud-table-container {
    overflow-x: auto;
}

/* Responsive: smaller gauge on mobile */
@media (max-width: 600px) {
    .gauge-value {
        font-size: 1.6rem;
    }

    .metric-card {
        min-height: 80px;
    }
}

/* ApexCharts dark mode tweaks */
.apexcharts-legend-text {
    color: rgba(255,255,255,0.7) !important;
}

.apexcharts-xaxis-label,
.apexcharts-yaxis-label {
    fill: rgba(255,255,255,0.5) !important;
}

/* Live Pulse Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4caf50;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    position: relative;
}

.live-dot::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.4);
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Memory bar for user ranking */
.memory-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.memory-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c8aff, #00e5c8);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
}

/* Programs table: sticky header + sortable columns */
.programs-scroll-container {
    position: relative;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
}

/* MudSimpleTable adds .mud-table-container — disable its own overflow so our parent controls it */
.programs-scroll-container .mud-table-container {
    overflow: visible !important;
}

.programs-sticky-header {
    position: sticky;
    top: 0;
    z-index: 2;
}

.programs-sticky-header th {
    background: #1e1e2f;
    box-shadow: 0 1px 0 rgba(255,255,255,0.1);
}

.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.sortable-header:hover {
    color: #7c8aff !important;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}
