﻿/* Full-screen dimmed overlay */
.error-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 20, 30, 0.45);
    backdrop-filter: blur(2px);
    outline: none;
    animation: overlayFade 0.15s ease-out;
}

/* The card */
.error-modal {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.18s ease-out;
}

.error-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #eee;
}

    .error-modal-header h4 {
        margin: 0;
        font-weight: 700;
    }

.error-modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #555;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s;
}

    .error-modal-close:hover {
        background: #f1f1f4;
        color: #000;
    }

.error-modal-body {
    padding: 16px 24px;
    overflow-y: auto; /* long messages scroll inside the card */
}

.error-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 24px 20px;
    border-top: 1px solid #eee;
}

/* Detail rows */
.error-details-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .detail-item.full-width {
        grid-column: 1 / -1;
    }

    .detail-item label {
        margin: 0;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #888;
    }

    .detail-item .code-text {
        margin: 0;
        padding: 12px;
        background: #f6f6f9;
        border-radius: 8px;
        font-size: 0.85rem;
        white-space: pre-wrap; /* wrap JSON / HTML error payloads */
        word-break: break-word;
    }

@media (max-width: 600px) {
    .error-details-list {
        grid-template-columns: 1fr;
    }
}

@keyframes overlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
