/* Styles/acur-error-boundary.css */
/* AcurBusiness V5 — Error Boundary UI */
/* Importer dans app.css ou wwwroot/css/app.css :  @import 'acur-error-boundary.css'; */

/* ─── Overlay ──────────────────────────────────────────────────────────── */
.acur-error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: acur-fade-in 0.2s ease;
}

/* ─── Panel ────────────────────────────────────────────────────────────── */
.acur-error-panel {
    background: var(--surface-card, #ffffff);
    border-radius: 12px;
    border-top: 4px solid #e53935;
    width: min(580px, 94vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: acur-slide-up 0.25s ease;
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.acur-error-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: #fff5f5;
    border-bottom: 1px solid #fecdd3;
}

.acur-error-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.acur-error-title {
    font-weight: 600;
    color: #b91c1c;
    flex: 1;
    font-size: 0.95rem;
}

.acur-error-id {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

/* ─── Body ─────────────────────────────────────────────────────────────── */
.acur-error-body {
    padding: 1.25rem;
}

.acur-error-message {
    font-weight: 500;
    color: #1e293b;
    margin: 0 0 0.5rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.acur-error-inner {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

/* ─── Details / Stack Trace ────────────────────────────────────────────── */
.acur-error-details {
    margin-top: 0.75rem;
}

.acur-error-details > summary {
    cursor: pointer;
    color: var(--brand-primary, #5E509D);
    font-size: 0.82rem;
    font-weight: 500;
    user-select: none;
    padding: 0.25rem 0;
    list-style: none;
}

.acur-error-details > summary::before {
    content: '▶ ';
    font-size: 0.65rem;
    transition: transform 0.15s;
    display: inline-block;
}

.acur-error-details[open] > summary::before {
    transform: rotate(90deg);
}

.acur-error-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.78rem;
    padding: 0.2rem 0;
    color: #475569;
}

.acur-meta-label {
    font-weight: 600;
    color: #334155;
    min-width: 70px;
}

.acur-meta-value {
    font-family: 'Courier New', Courier, monospace;
    word-break: break-all;
}

.acur-error-stack {
    margin-top: 0.6rem;
    font-size: 0.72rem;
    line-height: 1.6;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    overflow-x: auto;
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', Courier, monospace;
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.acur-error-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.acur-btn-copy,
.acur-btn-recover {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
}

.acur-btn-copy {
    background: var(--gradient-brand, linear-gradient(135deg, #5E509D 0%, #3E3E90 100%));
    color: #ffffff;
}

.acur-btn-recover {
    background: #e2e8f0;
    color: #1e293b;
}

.acur-btn-copy:hover,
.acur-btn-recover:hover {
    opacity: 0.85;
}

.acur-btn-copy:active,
.acur-btn-recover:active {
    transform: scale(0.98);
}

/* ─── Feedback "Copié !" ────────────────────────────────────────────────── */
.acur-copy-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10000;
    animation: acur-toast-in 0.2s ease, acur-toast-out 0.3s ease 1.8s forwards;
    pointer-events: none;
}

/* ─── Animations ────────────────────────────────────────────────────────── */
@keyframes acur-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes acur-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes acur-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
}

@keyframes acur-toast-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}
