/**
 * Amphyx Custom Dialog System (Modal Alert & Confirm)
 * Design Identity: Navy (#0c2e60) & Coral (#ee390f), Modern Glassmorphism
 */

/* Overlay Container */
.cx-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 46, 96, 0.52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
    box-sizing: border-box;
}

.cx-dialog-overlay.cx-dialog-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
.cx-dialog-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 60px -12px rgba(12, 46, 96, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.85);
    position: relative;
    overflow: hidden;
    padding: 28px 24px 22px 24px;
    text-align: center;
    transform: scale(0.92) translateY(14px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease-out;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cx-dialog-overlay.cx-dialog-active .cx-dialog-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Dismiss / Close X */
.cx-dialog-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.cx-dialog-close-btn:hover {
    background: #e2e8f0;
    color: #0c2e60;
}

/* Icon Container */
.cx-dialog-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cx-dialog-icon-wrap svg {
    width: 30px;
    height: 30px;
    stroke-width: 2.2;
}

/* Type Variants */
/* Info (Navy) */
.cx-dialog-type-info .cx-dialog-icon-wrap {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #0c2e60;
}

/* Success (Emerald) */
.cx-dialog-type-success .cx-dialog-icon-wrap {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    color: #059669;
}

/* Warning (Amber) */
.cx-dialog-type-warning .cx-dialog-icon-wrap {
    background: #fffbeb;
    border: 2px solid #fde68a;
    color: #d97706;
}

/* Danger (Coral / Red) */
.cx-dialog-type-danger .cx-dialog-icon-wrap {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #ee390f;
}

/* Typography */
.cx-dialog-title {
    font-size: 19px;
    font-weight: 800;
    color: #0c2e60;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.cx-dialog-message {
    font-size: 14.5px;
    color: #475569;
    line-height: 1.55;
    margin: 0 0 24px 0;
    white-space: pre-line;
    word-break: break-word;
    font-weight: 400;
}

/* Action Buttons Container */
.cx-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

/* Base Dialog Button */
.cx-dialog-btn {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
    text-decoration: none;
}

.cx-dialog-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(12, 46, 96, 0.25);
}

/* Cancel Button */
.cx-dialog-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    flex: 1;
}

.cx-dialog-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Primary / Confirm Button (Navy) */
.cx-dialog-btn-primary {
    background: #0c2e60;
    color: #ffffff;
    flex: 1.25;
    box-shadow: 0 4px 14px rgba(12, 46, 96, 0.25);
}

.cx-dialog-btn-primary:hover {
    background: #091f42;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(12, 46, 96, 0.32);
}

.cx-dialog-btn-primary:active {
    transform: translateY(0);
}

/* Single Alert Button */
.cx-dialog-btn-single {
    width: 100%;
    flex: none;
}

/* Danger Confirm Button (Coral) */
.cx-dialog-btn-danger {
    background: #ee390f;
    color: #ffffff;
    flex: 1.25;
    box-shadow: 0 4px 14px rgba(238, 57, 15, 0.28);
}

.cx-dialog-btn-danger:hover {
    background: #d6310a;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(238, 57, 15, 0.38);
}

.cx-dialog-btn-danger:active {
    transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .cx-dialog-card {
        padding: 24px 18px 20px 18px;
        border-radius: 18px;
    }
    .cx-dialog-title {
        font-size: 17.5px;
    }
    .cx-dialog-message {
        font-size: 13.5px;
        margin-bottom: 20px;
    }
    .cx-dialog-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .cx-dialog-btn {
        width: 100%;
        flex: none;
    }
}
