/*
 * Dialog konfirmasi untuk widget asisten.
 * Menggantikan confirm() browser supaya gaya, fokus, dan keyboard
 * konsisten dengan tema situs.
 *
 * Dipakai oleh: beranda (widget chat), /chatbot (halaman chat).
 * Markup: resources/views/components/chat-confirm-dialog.blade.php
 * Logika: public/assets/js/chat-confirm.js
 */

.chat-confirm {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    --chat-confirm-accent: #00B9D1;
}

.chat-confirm[hidden] {
    display: none;
}

.chat-confirm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-confirm.is-open .chat-confirm__backdrop {
    opacity: 1;
}

.chat-confirm__panel {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 22px 20px 18px;
    text-align: center;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chat-confirm.is-open .chat-confirm__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-confirm__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    font-size: 20px;
    color: var(--chat-confirm-accent);
    background: rgba(0, 185, 209, 0.12);
}

.chat-confirm__title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.chat-confirm__text {
    margin: 0 0 18px;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #6b7280;
}

.chat-confirm__actions {
    display: flex;
    gap: 10px;
}

.chat-confirm__btn {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.chat-confirm__btn:active {
    transform: scale(0.98);
}

.chat-confirm__btn--cancel {
    background: #f1f5f9;
    color: #475569;
}

.chat-confirm__btn--cancel:hover {
    background: #e2e8f0;
}

.chat-confirm__btn--danger {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.chat-confirm__btn--danger:hover {
    background: #b91c1c;
}

.chat-confirm__btn:focus-visible {
    outline: 3px solid rgba(0, 185, 209, 0.35);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .chat-confirm__backdrop,
    .chat-confirm__panel {
        transition: none;
    }
}
