/* ================================================================================
 * CHUPINO DIALOG & TOAST SYSTEM
 * Thiết kế giao diện hộp thoại và thông báo chuyên nghiệp, chuẩn UI Chupino
 * ================================================================================ */

/* ================================================================================
 * CHUPINO POS APPLICATION-WIDE PROTECTION (NO SELECT & NO RIGHT CLICK DRAG)
 * Ngăn chặn toàn bộ việc bôi đen giao diện, chống kéo thả nhầm lẫn
 * ================================================================================ */
*, *::before, *::after {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}

input, textarea, [contenteditable="true"], .allow-select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* OVERLAY MỜ HẬU CẢNH */
.chupino-dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.22s ease;
    padding: 16px;
}
.chupino-dialog-overlay.active {
    opacity: 1;
}

/* HỘP THOẠI DIALOG */
.chupino-dialog-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.8);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    text-align: center;
    padding: 26px 22px;
}
.chupino-dialog-overlay.active .chupino-dialog-card {
    transform: scale(1) translateY(0);
}

/* BIỂU TƯỢNG ICON */
.chupino-dialog-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
    box-shadow: 0 8px 18px -4px rgba(0, 0, 0, 0.08);
}
.chupino-dialog-icon.success { background: #dcfce7; color: #16a34a; }
.chupino-dialog-icon.warning { background: #fef3c7; color: #d97706; }
.chupino-dialog-icon.danger  { background: #fee2e2; color: #dc2626; }
.chupino-dialog-icon.info    { background: #e0f2fe; color: #0284c7; }
.chupino-dialog-icon.primary { background: #eff6ff; color: #2563eb; }

/* TIÊU ĐỀ & NỘI DUNG */
.chupino-dialog-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.35;
}
.chupino-dialog-msg {
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 22px 0;
    word-break: break-word;
}

/* NÚT THAO TÁC */
.chupino-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.chupino-dialog-actions button {
    flex: 1;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.chupino-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}
.chupino-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.chupino-btn-confirm-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.chupino-btn-confirm-danger:hover { background: #b91c1c; }
.chupino-btn-confirm-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.chupino-btn-confirm-primary:hover { background: #1d4ed8; }
.chupino-btn-confirm-success {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.chupino-btn-confirm-success:hover { background: #15803d; }
.chupino-btn-confirm-warning {
    background: #ea580c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}
.chupino-btn-confirm-warning:hover { background: #c2410c; }

/* TOAST THÔNG BÁO GÓC TRÊN BÊN PHẢI */
.chupino-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 40px);
}
.chupino-toast-item {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 13px 18px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(226, 232, 240, 0.85);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: #1e293b;
    font-weight: 600;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}
.chupino-toast-item.show {
    transform: translateX(0);
    opacity: 1;
}
.chupino-toast-item.hide {
    transform: translateX(120%);
    opacity: 0;
}
.chupino-toast-icon {
    font-size: 19px;
    flex-shrink: 0;
}
.chupino-toast-item.success .chupino-toast-icon { color: #16a34a; }
.chupino-toast-item.warning .chupino-toast-icon { color: #ea580c; }
.chupino-toast-item.error   .chupino-toast-icon { color: #dc2626; }
.chupino-toast-item.info    .chupino-toast-icon { color: #2563eb; }

/* HỖ TRỢ DARK THEME (NHÀ BẾP KDS) */
body.dark-theme .chupino-dialog-card {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}
body.dark-theme .chupino-dialog-title {
    color: #f8fafc;
}
body.dark-theme .chupino-dialog-msg {
    color: #94a3b8;
}
body.dark-theme .chupino-btn-cancel {
    background: #334155;
    color: #cbd5e1;
}
body.dark-theme .chupino-btn-cancel:hover {
    background: #475569;
    color: #ffffff;
}
body.dark-theme .chupino-toast-item {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}
