/* ===== Design Tokens ===== */
:root {
    --color-bg-primary: #0d1117;
    --color-bg-secondary: #161b22;
    --color-bg-card: #1c2128;
    --color-accent: #58a6ff;
    --color-accent-hover: #79b8ff;
    --color-text-primary: #e6edf3;
    --color-text-secondary: #8b949e;
    --color-border: #30363d;
    --font-primary: 'Inter', system-ui, sans-serif;
    --nav-height: 64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
    min-height: 100%;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-primary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: none;
}

/* ===== Bootstrap dark overrides ===== */
.card {
    background-color: var(--color-bg-card);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}

.badge {
    font-weight: 500;
}

/* ===== Blazor Loading Progress ===== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--color-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--color-text-secondary);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    background: #2d1f00;
    border-top: 1px solid #f39c12;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #f39c12;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
