/* ══════════════════════════════════════════════════════════════════
   notify.css  —  Toast · Error Modal · Loading Overlay · Confirm Modal
   ใช้ร่วมกันทุกหน้า  |  ต้อง include notify.js คู่กันด้วย
══════════════════════════════════════════════════════════════════ */

/* ── Toast animations ── */
@keyframes toastSpin {
    to { transform: rotate(360deg); }
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(24px); }
}

/* ── Toast element ── */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
    min-width: 280px;
    max-width: 420px;
    width: max-content;
}
#toast.toast-show {
    animation: toastSlideIn 0.22s cubic-bezier(.34,1.56,.64,1) forwards;
}
#toast.toast-hidden {
    animation: toastSlideOut 0.18s ease forwards;
    pointer-events: none;
}

/* ── Backdrop / Modal shared ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

/* ── Loading overlay ── */
#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    justify-content: center;
}
#loadingOverlay.hidden {
    display: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   Dark theme — Toast & Modals
══════════════════════════════════════════ */

/* toast */
[data-theme="black"] #toast {
    background: #3F3F3F !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.08) !important;
}
[data-theme="black"] #toast #toastTitle { color: #f0ece4 !important; }
[data-theme="black"] #toast #toastMsg   { color: #94a3b8 !important; }
[data-theme="black"] #toast #toastClose { color: #94a3b8 !important; }

/* modal backdrop & box */
[data-theme="black"] .modal-backdrop {
    background: rgba(15, 23, 42, .75) !important;
}
[data-theme="black"] .modal-box {
    background: #3F3F3F !important;
    color: #f0ece4 !important;
}

/* error modal specifics */
[data-theme="black"] #errorModal > div {
    background-color: #3F3F3F !important;
}
[data-theme="black"] #errorModal [style*="background:#fef2f2"] {
    background-color: rgba(220, 38, 38, .12) !important;
}
[data-theme="black"] #errorModal [style*="color:#ef4444"] {
    color: #fca5a5 !important;
}
[data-theme="black"] #errorModal [style*="background:#ef4444"] {
    background-color: #ef4444 !important;
}
[data-theme="black"] .w-16.h-16.rounded-full {
    background-color: rgba(220, 38, 38, .12) !important;
}

/* print / pring modals */
[data-theme="black"] #printTicketModal,
[data-theme="black"] #purchaseModal {
    background: rgba(15, 23, 42, .75) !important;
}

/* ══════════════════════════════════════════
   Confirm Modal — dark theme
══════════════════════════════════════════ */
[data-theme="black"] #confirmModal {
    background: rgba(15, 23, 42, .75) !important;
}
[data-theme="black"] #confirmModal .modal-box {
    background: #3F3F3F !important;
}
[data-theme="black"] #confirmModal #_confirmTitle {
    color: #f0ece4 !important;
}
[data-theme="black"] #confirmModal #_confirmMsg {
    color: #94a3b8 !important;
}
[data-theme="black"] #confirmModal #_confirmCancel {
    background: #525252 !important;
    border-color: #666 !important;
    color: #e5e7eb !important;
}
[data-theme="black"] #confirmModal #_confirmCancel:hover {
    background: #616161 !important;
}