/**
 * Maqam Alert - system-wide confirm / alert / toast UI.
 * Matches Maqam admin branding and replaces native browser dialogs.
 */
:root {
    --maqam-alert-primary: #006194;
    --maqam-alert-secondary: #00677d;
    --maqam-alert-surface: #f7f9ff;
    --maqam-alert-border: #d3e4fe;
    --maqam-alert-text: #0b1c30;
    --maqam-alert-muted: #404850;
    --maqam-alert-danger: #b91c1c;
    --maqam-alert-success: #15803d;
    --maqam-alert-warning: #c2410c;
}

.maqam-alert-overlay {
    align-items: center;
    background: rgba(11, 28, 48, 0.52);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 20050;
}

.maqam-alert-overlay.is-open {
    display: flex;
    animation: maqam-alert-fade-in 0.18s ease;
}

.maqam-alert-dialog {
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(11, 28, 48, 0.28);
    max-height: calc(100vh - 2rem);
    max-width: 460px;
    overflow: hidden;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s ease;
    width: 100%;
}

.maqam-alert-overlay.is-open .maqam-alert-dialog {
    transform: translateY(0) scale(1);
}

.maqam-alert-hero {
    align-items: flex-start;
    background:
        radial-gradient(circle at top right, rgba(80, 217, 254, 0.28), transparent 45%),
        linear-gradient(135deg, #006194 0%, #0a4f73 55%, #00677d 100%);
    color: #fff;
    display: flex;
    gap: 14px;
    padding: 22px 22px 18px;
}

.maqam-alert-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 22px;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.maqam-alert-hero h3 {
    font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 4px;
}

.maqam-alert-hero p {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0;
    text-transform: uppercase;
}

.maqam-alert-body {
    background: var(--maqam-alert-surface);
    color: var(--maqam-alert-text);
    font-size: 0.98rem;
    line-height: 1.55;
    padding: 20px 22px;
}

.maqam-alert-body p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.maqam-alert-footer {
    background: #fff;
    border-top: 1px solid rgba(211, 228, 254, 0.9);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 18px 18px;
}

.maqam-alert-btn {
    align-items: center;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 800;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.maqam-alert-btn:hover {
    transform: translateY(-1px);
}

.maqam-alert-btn:focus-visible {
    outline: 2px solid rgba(0, 97, 148, 0.35);
    outline-offset: 2px;
}

.maqam-alert-btn.ghost {
    background: #fff;
    border: 1px solid rgba(211, 228, 254, 0.95);
    color: var(--maqam-alert-muted);
}

.maqam-alert-btn.primary {
    background: linear-gradient(135deg, #006194, #00677d);
    box-shadow: 0 10px 22px rgba(0, 97, 148, 0.26);
    color: #fff;
}

.maqam-alert-btn.danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 10px 22px rgba(185, 28, 28, 0.24);
    color: #fff;
}

.maqam-alert-btn.success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 10px 22px rgba(21, 128, 61, 0.24);
    color: #fff;
}

.maqam-alert-dialog.is-danger .maqam-alert-hero {
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

.maqam-alert-dialog.is-success .maqam-alert-hero {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
}

.maqam-alert-dialog.is-warning .maqam-alert-hero {
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
}

.maqam-alert-toast-stack {
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: fixed;
    right: 24px;
    z-index: 20100;
}

.maqam-alert-toast {
    align-items: flex-start;
    animation: maqam-alert-slide-in 0.22s ease;
    background: #fff;
    border-left: 4px solid var(--maqam-alert-primary);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(11, 28, 48, 0.16);
    color: var(--maqam-alert-text);
    display: flex;
    font-size: 13px;
    font-weight: 600;
    gap: 10px;
    max-width: 380px;
    padding: 14px 16px;
}

.maqam-alert-toast.success { border-left-color: var(--maqam-alert-success); }
.maqam-alert-toast.error,
.maqam-alert-toast.danger { border-left-color: var(--maqam-alert-danger); }
.maqam-alert-toast.warning { border-left-color: var(--maqam-alert-warning); }
.maqam-alert-toast.info { border-left-color: var(--maqam-alert-primary); }

.maqam-alert-toast .maqam-alert-toast-icon {
    color: var(--maqam-alert-primary);
    font-size: 20px;
    line-height: 1;
}

.maqam-alert-toast.success .maqam-alert-toast-icon { color: var(--maqam-alert-success); }
.maqam-alert-toast.error .maqam-alert-toast-icon,
.maqam-alert-toast.danger .maqam-alert-toast-icon { color: var(--maqam-alert-danger); }
.maqam-alert-toast.warning .maqam-alert-toast-icon { color: var(--maqam-alert-warning); }

@keyframes maqam-alert-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes maqam-alert-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .maqam-alert-toast-stack {
        left: 16px;
        right: 16px;
    }
    .maqam-alert-toast {
        max-width: none;
    }
    .maqam-alert-footer {
        flex-direction: column-reverse;
    }
    .maqam-alert-btn {
        justify-content: center;
        width: 100%;
    }
}
