/* Copyright (c) Zhmara X LLC. All rights reserved.
   Proprietary and confidential. Unauthorized copying of this file, via any medium, is prohibited. See LICENSE.txt. */

/* The "page stopped working" notice (ZxErrorNotice, Blazor's #blazor-error-ui): a dimmed page with the Zhmara X card in
   the middle, navy top with the white logo, the message, an orange Reload pill and a Close link. The same file in
   every Zhmara X app with a live connection; loaded last, so it wins over the template and App.css rules for the
   same element. Blazor shows it with an inline display: block. Its own colour names, so it looks the same in
   every app; logical properties for Arabic and Kurdish. */

#blazor-error-ui {
    --zxe-navy: #252c39;
    --zxe-orange: #f68d0b;
    --zxe-orange-dark: #d97800;
    --zxe-blue: #47b2e4;
    --zxe-text: #2a2929;
    --zxe-muted: #5b6475;

    display: none;
    position: fixed;
    inset: 0;
    z-index: 10400;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    transform: none;
    background: rgba(13, 21, 35, .55);
    box-shadow: none;
    color: var(--zxe-text);
    font-family: "Open Sans", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
    text-align: center;
}

#blazor-error-ui .zx-error-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100% - 32px));
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(13, 21, 35, .35);
    animation: zx-error-in .25s ease-out;
}

#blazor-error-ui .zx-error-top {
    display: flex;
    justify-content: center;
    padding: 16px;
    background: var(--zxe-navy);
}

#blazor-error-ui .zx-error-top img {
    display: block;
    height: 34px;
    width: auto;
}

#blazor-error-ui .zx-error-body { padding: 24px 24px 22px; }

#blazor-error-ui .zx-error-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(246, 141, 11, .14);
    color: var(--zxe-orange);
}

#blazor-error-ui h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--zxe-text);
}

#blazor-error-ui p {
    margin: 0 0 20px;
    font-size: .95rem;
    color: var(--zxe-muted);
}

#blazor-error-ui .zx-error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

#blazor-error-ui .zx-error-reload,
#blazor-error-ui .zx-error-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 9px 22px;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

#blazor-error-ui .zx-error-reload {
    border: 2px solid var(--zxe-orange);
    background: var(--zxe-orange);
    color: #fff;
}

#blazor-error-ui .zx-error-reload:hover { background: var(--zxe-orange-dark); border-color: var(--zxe-orange-dark); color: #fff; }

#blazor-error-ui .zx-error-close {
    position: static;
    border: 2px solid var(--zxe-blue);
    background: transparent;
    color: var(--zxe-navy);
}

#blazor-error-ui .zx-error-close:hover { background: var(--zxe-blue); color: #fff; }

@keyframes zx-error-in {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (prefers-reduced-motion: reduce) {
    #blazor-error-ui .zx-error-card { animation: none; }
}
