/* /Components/Layout/MainLayout.razor.rz.scp.css */
/* App-skallens layoutregler bor i app.css (.app-shell/.app-sidebar/.app-main),
   så rum-listens klasser kan styles uden ::deep. Her bor kun fejl-banneret. */

#blazor-error-ui[b-ervr6z0wbi] {
    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[b-ervr6z0wbi] {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/* P5: forbindelses-status i Sagas eget sprog — aldrig en rå browserfejl.
   Pillen er den primære status (diskret, øverst, puls-prik); dialogen er
   fuld-overlayet der først åbnes af JS efter >10 sek. afbrydelse. Alle
   farver er DESIGN.md-tokens, så light/dark følger automatisk med. */

#cc-conn-pill[b-wc4i3srlyn] {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translate(-50%, -16px);
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .42rem .95rem;
    border-radius: var(--cc-radius-pill);
    background: var(--cc-bg-elevated);
    color: var(--cc-text-secondary);
    border: 1px solid var(--cc-border);
    box-shadow: var(--cc-shadow-float);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

#cc-conn-pill.visible[b-wc4i3srlyn] {
    opacity: 1;
    transform: translate(-50%, 0);
}

.cc-conn-dot[b-wc4i3srlyn] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cc-danger);
    animation: cc-conn-pulse-b-wc4i3srlyn 1.2s ease-in-out infinite;
    flex: none;
}

@keyframes cc-conn-pulse-b-wc4i3srlyn {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.72); }
}

/* Pillen har to ansigter: "forbinder igen…" og den korte ok-kvittering. */
#cc-conn-pill .cc-conn-ok[b-wc4i3srlyn] { display: none; align-items: center; gap: .35rem; color: var(--cc-success); }
#cc-conn-pill.ok .cc-conn-ok[b-wc4i3srlyn] { display: inline-flex; }
#cc-conn-pill.ok .cc-conn-msg[b-wc4i3srlyn],
#cc-conn-pill.ok .cc-conn-dot[b-wc4i3srlyn] { display: none; }

/* ---- Fuld-overlayet (kun efter >10 sek.) ---- */

.components-reconnect-first-attempt-visible[b-wc4i3srlyn],
.components-reconnect-repeated-attempt-visible[b-wc4i3srlyn],
.components-reconnect-failed-visible[b-wc4i3srlyn],
.components-pause-visible[b-wc4i3srlyn],
.components-resume-failed-visible[b-wc4i3srlyn],
.components-rejoining-animation[b-wc4i3srlyn] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-retrying[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-failed[b-wc4i3srlyn],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-wc4i3srlyn] {
    display: block;
}

#components-reconnect-modal[b-wc4i3srlyn] {
    background: var(--cc-bg-elevated);
    color: var(--cc-text);
    width: min(20rem, calc(100vw - 2rem));
    margin: 20vh auto;
    padding: 2rem 1.75rem;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-bubble);
    box-shadow: var(--cc-shadow-float);
    outline: none; /* showModal() fokuserer dialogen — UA-ringen ligner en fejl */
    opacity: 0;
    transition: display 0.4s allow-discrete, overlay 0.4s allow-discrete;
    animation: cc-reconnect-fade-out-b-wc4i3srlyn 0.4s both;
}

#components-reconnect-modal[open][b-wc4i3srlyn] {
    animation: cc-reconnect-slide-up-b-wc4i3srlyn 0.5s cubic-bezier(.05, .89, .25, 1.02), cc-reconnect-fade-in-b-wc4i3srlyn 0.4s ease-in-out;
    animation-fill-mode: both;
}

#components-reconnect-modal[b-wc4i3srlyn]::backdrop {
    background: rgb(19 16 34 / .55);
    backdrop-filter: blur(3px);
    animation: cc-reconnect-fade-in-b-wc4i3srlyn 0.4s ease-in-out;
    opacity: 1;
}

@keyframes cc-reconnect-slide-up-b-wc4i3srlyn {
    0% { transform: translateY(24px) scale(0.96); }
    100% { transform: translateY(0); }
}

@keyframes cc-reconnect-fade-in-b-wc4i3srlyn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes cc-reconnect-fade-out-b-wc4i3srlyn {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.components-reconnect-container[b-wc4i3srlyn] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
}

.cc-reconnect-logo[b-wc4i3srlyn] {
    border-radius: 14px;
    box-shadow: var(--cc-shadow);
}

.cc-reconnect-title[b-wc4i3srlyn] {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cc-text);
}

#components-reconnect-modal p[b-wc4i3srlyn] {
    margin: 0;
    text-align: center;
    font-size: .9rem;
    color: var(--cc-text-secondary);
}

#components-reconnect-modal button[b-wc4i3srlyn] {
    border: 0;
    background: var(--cc-accent);
    color: #fff;
    padding: .45rem 1.5rem;
    border-radius: var(--cc-radius-pill);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
}

#components-reconnect-modal button:hover[b-wc4i3srlyn] {
    background: var(--cc-accent-hover);
}

/* De pulserende ringe genbruges fra skabelonen, men i accentfarven,
   mindre og uden hop — det skal føles som appens egen "tænker"-puls. */
.components-rejoining-animation[b-wc4i3srlyn] {
    position: relative;
    width: 56px;
    height: 56px;
}

.components-rejoining-animation div[b-wc4i3srlyn] {
    position: absolute;
    border: 3px solid var(--cc-accent);
    opacity: 1;
    border-radius: 50%;
    animation: cc-rejoining-b-wc4i3srlyn 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.components-rejoining-animation div:nth-child(2)[b-wc4i3srlyn] {
    animation-delay: -0.75s;
}

@keyframes cc-rejoining-b-wc4i3srlyn {
    0% {
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cc-conn-dot[b-wc4i3srlyn] { animation: none; }
    .components-rejoining-animation div[b-wc4i3srlyn] { animation: none; opacity: .4; inset: 0; width: auto; height: auto; }
    #components-reconnect-modal[b-wc4i3srlyn], #components-reconnect-modal[open][b-wc4i3srlyn] { animation: none; opacity: 1; }
}
