/* CerView app styles. Colors, spacing and type come from ZenithUI tokens (--zen-*); no zen-* class is targeted. */

html, body {
    margin: 0;
    font-family: var(--zen-font-family, system-ui, sans-serif);
    background: var(--zen-bg-base, #fff);
    color: var(--zen-text-primary, #111);
}

h1:focus {
    outline: none;
}

/* ─── App shell ─── */
.cv-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.cv-main {
    flex: 1;
    overflow: auto;
    padding: var(--zen-space-4, 16px) var(--zen-space-4, 16px) var(--zen-space-6, 32px);
}

/* ─── Footer: attribution only; stays out of the way of the reading area ─── */
.cv-footer {
    padding: var(--zen-space-3, 12px) var(--zen-space-4, 16px);
    border-top: 1px solid var(--zen-border-muted, #e5e5e5);
    font-size: var(--zen-font-size-xs, 12px);
    color: var(--zen-text-secondary, #666);
    text-align: center;
}

.cv-footer a {
    color: inherit;
}

/* ─── File picker: a label wrapping the native InputFile, styled as the primary action ─── */
.cv-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--zen-space-2, 8px);
    min-height: 44px;
    padding: 0 var(--zen-space-5, 24px);
    border-radius: var(--zen-radius-md, 6px);
    background: var(--zen-accent, #2563eb);
    color: var(--zen-accent-text, #fff);
    font-weight: var(--zen-font-weight-semibold, 600);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

.cv-picker:hover {
    background: var(--zen-accent-hover, #1d4ed8);
}

.cv-picker:active {
    background: var(--zen-accent-active, #1e40af);
}

.cv-picker:focus-within {
    outline: 3px solid var(--zen-ring, #93c5fd);
    outline-offset: 2px;
}

.cv-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ─── Result layout ─── */
.cv-cards {
    display: grid;
    gap: var(--zen-space-4, 16px);
}

.cv-card-title {
    display: flex;
    align-items: center;
    gap: var(--zen-space-3, 12px);
    flex-wrap: wrap;
}

.cv-file-meta {
    margin: 0 0 var(--zen-space-4, 16px);
    color: var(--zen-text-secondary, #555);
    font-size: var(--zen-font-size-sm, 13px);
    overflow-wrap: anywhere;
}

.cv-field {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto;
    gap: var(--zen-space-3, 12px);
    align-items: start;
    padding: var(--zen-space-3, 12px) 0;
    border-bottom: 1px solid var(--zen-border-muted, #eee);
}

.cv-field:last-child {
    border-bottom: 0;
}

.cv-field__label {
    color: var(--zen-text-secondary, #555);
    font-size: var(--zen-font-size-sm, 13px);
    padding-top: 6px;
}

.cv-field__hint {
    display: block;
    color: var(--zen-text-muted, #888);
    font-family: var(--zen-font-family-mono, monospace);
    font-size: var(--zen-font-size-xs, 11px);
}

.cv-field__value {
    min-width: 0;
    padding-top: 6px;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.cv-field__value--mono {
    font-family: var(--zen-font-family-mono, monospace);
}

.cv-field__actions {
    display: flex;
    align-items: center;
}

.cv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--zen-space-2, 8px);
}

.cv-evidence {
    display: block;
    margin-top: var(--zen-space-1, 4px);
    color: var(--zen-text-muted, #888);
    font-size: var(--zen-font-size-xs, 11px);
}

.cv-inline {
    display: flex;
    align-items: center;
    gap: var(--zen-space-2, 8px);
    flex-wrap: wrap;
}

.cv-extensions {
    margin: 0;
    padding-left: var(--zen-space-5, 24px);
    line-height: 1.7;
}

@media (max-width: 640px) {
    .cv-field {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .cv-field__label {
        grid-column: 1 / -1;
        padding-top: 0;
    }

    .cv-field__value {
        padding-top: 0;
    }
}

/* ─── Boot progress (Blazor template) ─── */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1f2937;
    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;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Cargando");
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
