/* Loader Overlay - identico a CENET.CRM.crmadmin (boot WASM + utilidades compartidas) */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

.loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--loading-color, #3b82f6);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
}

.loading-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

@keyframes loading-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Boot WASM: pantalla completa antes de que Blazor monte #app */
.loading-overlay--boot {
    background: var(--color-bg, #1a2533);
}

.loading-overlay--boot .loading-text,
.loading-overlay--boot > p {
    color: var(--color-text, #ffffff);
    font-size: 1rem;
    margin: 0;
}

.loading-overlay--boot .loading-spinner {
    border-top-color: var(--color-accent, #1abc9c);
}

.kanban-board {
    position: relative;
}

/* Overlay local Kanban: reglas completas (no depende de .loading-overlay global) */
.kanban-board .loading-overlay.loading-overlay--local {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Runtime global: maxima prioridad sobre bootstrap/styles.css */
.loading-overlay.app-global-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

.loading-overlay.app-global-loading-overlay .loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-overlay.app-global-loading-overlay .loading-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--loading-color, #3b82f6);
    border-radius: 50%;
    animation: loading-spin 1s linear infinite;
    margin-bottom: 0;
}

.loading-overlay.app-global-loading-overlay .loading-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* Estados de carga en pagina */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
    color: var(--color-text-secondary);
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--color-danger, #e74c3c);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    color: #fff;
    display: none;
    left: 0;
    padding: 10px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000001;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 8px;
}

#blazor-error-ui a.reload {
    color: #fff;
    text-decoration: underline;
}
