/* ============================================================
   ONVSHARK ALERT
   Author  : Refael Sinaga 2026 | refaelsinaga.com
   Version : 1.0.0
   Prefix  : onvs-alert-
   ============================================================ */

/* ── overlay ── */
.onvs-alert-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: onvsAlertOverlayIn .2s ease-out;
}

.onvs-alert-overlay.onvs-alert-closing {
    animation: onvsAlertOverlayOut .2s ease-in forwards;
}

/* ── box ── */
.onvs-alert-box {
    background: #fff;
    border-radius: 16px;
    border: 1.5px solid transparent;
    box-shadow: 0 4px 6px rgba(0,0,0,.06), 0 20px 48px rgba(0,0,0,.16), 0 2px 4px rgba(0,0,0,.04);
    width: 100%;
    max-width: 400px;
    padding: 32px 28px 24px;
    position: relative;
    text-align: center;
    animation: onvsAlertBoxIn .25s cubic-bezier(.34,1.56,.64,1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.onvs-alert-overlay.onvs-alert-closing .onvs-alert-box {
    animation: onvsAlertBoxOut .18s ease-in forwards;
}

/* ── warna border per type ── */
.onvs-alert-box.onvs-alert-success { border-color: #2ab57d; }
.onvs-alert-box.onvs-alert-danger  { border-color: #fd625e; }
.onvs-alert-box.onvs-alert-warning { border-color: #ffbf53; }
.onvs-alert-box.onvs-alert-info    { border-color: #4ba6ef; }

/* ── tombol X pojok kanan ── */
.onvs-alert-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #adb5bd;
    padding: 0;
    transition: background .15s, color .15s;
}

.onvs-alert-x:hover {
    background: #f3f4f6;
    color: #343a40;
}

.onvs-alert-x svg { width: 16px; height: 16px; stroke-width: 2.5; }

/* ── icon bulat ── */
.onvs-alert-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.onvs-alert-icon-wrap svg { width: 30px; height: 30px; stroke-width: 2; }

.onvs-alert-success .onvs-alert-icon-wrap { background: rgba(42,181,125,.14);  color: #2ab57d; }
.onvs-alert-danger  .onvs-alert-icon-wrap { background: rgba(253,98,94,.14);   color: #fd625e; }
.onvs-alert-warning .onvs-alert-icon-wrap { background: rgba(255,191,83,.14);  color: #b3863a; }
.onvs-alert-info    .onvs-alert-icon-wrap { background: rgba(75,166,239,.14);  color: #4ba6ef; }

.onvs-alert-no-icon .onvs-alert-icon-wrap { display: none; }

/* ── teks ── */
.onvs-alert-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    line-height: 1.35;
}

.onvs-alert-message {
    font-size: 13px;
    color: #74788d;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ── buttons ── */
.onvs-alert-buttons {
    display: flex;
    gap: 10px;
}

.onvs-alert-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid #dee2e6;
    background: #fff;
    color: #495057;
    transition: all .15s;
    font-family: inherit;
}

.onvs-alert-btn svg { width: 15px; height: 15px; stroke-width: 2.2; flex-shrink: 0; }

/* cancel */
.onvs-alert-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #adb5bd;
    color: #343a40;
}

/* confirm / action — warna dinamis via inline style */
.onvs-alert-btn-confirm {
    border-color: transparent;
    color: #fff;
}

.onvs-alert-btn-confirm:hover {
    filter: brightness(.9);
}

/* ── keyframes ── */
@keyframes onvsAlertOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes onvsAlertOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}
@keyframes onvsAlertBoxIn {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
@keyframes onvsAlertBoxOut {
    from { transform: scale(1);  opacity: 1; }
    to   { transform: scale(.85); opacity: 0; }
}
