/* ── Reset / base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1a202c;
}

/* ── Loading state (shown before Blazor boots) ────────────────────────────── */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
    color: #718096;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Upload wrapper ────────────────────────────────────────────────────────── */
.upload-wrapper {
    padding: 16px;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Metadata badge ────────────────────────────────────────────────────────── */
.metadata-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #2b6cb0;
    line-height: 1.5;
}

.metadata-badge strong { color: #1a365d; }

/* ── Initialisation error ──────────────────────────────────────────────────── */
.init-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
    color: #c53030;
    font-size: 14px;
}

/* ── Blazor error overlay ──────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #fffbeb;
    border-top: 2px solid #f6ad55;
    bottom: 0;
    color: #744210;
    display: none;           /* shown programmatically by Blazor on crash */
    font-size: 14px;
    left: 0;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .reload { color: #2b6cb0; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; font-size: 18px; }
