/* ==========================================================================
   modal.css
   Place at: static/css/modal.css
   Global CA Modal — replaces alert() and confirm()
   ========================================================================== */

/* ── Backdrop ── */
.ca-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    animation: caBackdropIn 0.15s ease;
}

.ca-modal-backdrop.active {
    display: flex;
}

@keyframes caBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Dialog box ── */
.ca-modal {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 420px;
    margin: 20px;
    overflow: hidden;
    animation: caModalIn 0.18s ease;
}

@keyframes caModalIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* ── Title bar ── */
.ca-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: #ffffff;
}

.ca-modal-header--success { background: #18A957; }
.ca-modal-header--warning { background: #FFBB38; color: #1a2535; }
.ca-modal-header--error   { background: #DF1642; }
.ca-modal-header--message { background: #0080FF; }

.ca-modal-header-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ca-modal-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

/* ── Body ── */
.ca-modal-body {
    padding: 22px 24px;
    font-size: 14px;
    color: #1a2535;
    line-height: 1.6;
}

/* ── Footer ── */
.ca-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px 24px;
}

/* ── Buttons ── */
.ca-modal-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.ca-modal-btn:hover  { transform: translateY(-1px); }
.ca-modal-btn:active { transform: translateY(0);    }

.ca-modal-btn-primary {
    background: #0080FF;
    color: #ffffff;
}

.ca-modal-btn-primary:hover { background: #006ddb; }

.ca-modal-btn-danger {
    background: #DF1642;
    color: #ffffff;
}

.ca-modal-btn-danger:hover { background: #b8102f; }

.ca-modal-btn-secondary {
    background: #eef1f5;
    color: #4a5568;
}

.ca-modal-btn-secondary:hover { background: #dce4ef; }
