/* ============================================
   PreahChanMC - ABA KHQR Payment & Modal Styles
   ============================================ */

/* ── Checkout Dialog Close Button (Top-Right Circle) ── */
.checkout-dialog {
    position: relative !important;
}

.checkout-dialog > [data-slot="dialog-close"] {
    position: absolute !important;
    top: 18px !important;
    right: 18px !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    z-index: 30 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 0 !important;
}
.checkout-dialog > [data-slot="dialog-close"]:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: var(--gold, #ffd700) !important;
    color: var(--gold, #ffd700) !important;
    transform: scale(1.06) !important;
}

/* ── ABA KHQR Main Wrapper ── */
.aba-khqr-wrapper {
    width: min(100%, 420px);
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}
.aba-khqr-wrapper[hidden], #payment-before[hidden], #payment-result[hidden], #payment-error[hidden] { 
    display: none !important; 
}

/* Make container fill height when ticket is active */
.khqr-waiting:has(.aba-khqr-wrapper:not([hidden])) {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    flex: 1;
}

/* ── ABA Header Bar: < ABA KHQR ... 02:59 ── */
.aba-khqr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Header Back Button (Circular) */
.aba-back-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
}
.aba-back-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: var(--gold, #ffd700) !important;
    color: var(--gold, #ffd700) !important;
    transform: scale(1.06) !important;
}

/* Header Title (Never wraps) */
.aba-header-title {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    flex: 1;
    text-align: left;
    margin-left: 14px;
    white-space: nowrap !important;
}

/* Circular Countdown Timer */
.aba-timer-ring {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.aba-timer-svg {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}
.aba-timer-text {
    font-family: var(--font-display, "Space Grotesk", monospace);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff !important;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* ── White Ticket Card with Red KHQR Banner ── */
.aba-khqr-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

/* Red KHQR banner across top */
.aba-khqr-tab {
    background: #E1251B;
    color: #ffffff;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.14em;
    padding: 10px 0;
    text-align: center;
    line-height: 1;
}

.aba-card-body {
    padding: 18px 24px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.aba-merchant {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0 0 2px;
    text-align: left;
}

.aba-amount {
    margin: 0 0 14px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.aba-amount strong {
    font-size: 1.75rem;
    font-weight: 900;
    color: #1a202c;
    line-height: 1;
    letter-spacing: -0.04em;
}
.aba-amount span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #718096;
}

/* Dashed perforation line with side cutouts */
.aba-perforation {
    width: calc(100% + 48px);
    margin: 0 -24px 18px;
    border-top: 2.5px dashed #cbd5e1;
    position: relative;
}
.aba-perforation::before,
.aba-perforation::after {
    content: '';
    position: absolute;
    top: -11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card, #1c1e26);
}
.aba-perforation::before { left: -11px; }
.aba-perforation::after  { right: -11px; }

/* QR code container with centered ABA emblem */
.aba-qr-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
#ticket-qr {
    width: min(100%, 250px);
    aspect-ratio: 1;
    object-fit: contain;
    image-rendering: crisp-edges;
}

.aba-qr-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 2px;
}
.aba-qr-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Scan Instruction Text (Outside Card) */
.aba-scan-text {
    margin: 16px 0 0;
    font-size: 0.84rem;
    color: var(--soft-text, #9ea3b0);
    line-height: 1.55;
    text-align: center;
}

/* Status & Actions */
.aba-status-text {
    margin: 10px 0 4px;
    color: var(--soft-text, #9ea3b0);
    font-size: 0.82rem;
}

.aba-checkout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px auto 6px;
    padding: 10px 22px;
    border-radius: 99px;
    background: rgba(0, 114, 188, 0.18);
    border: 1.5px solid #0099ff;
    color: #00d2ff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 114, 188, 0.2);
}
.aba-checkout-link:hover {
    background: #0072BC;
    border-color: #00bcd4;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.38);
    transform: translateY(-1.5px);
}
.aba-checkout-link[hidden] { 
    display: none !important; 
}

.aba-cancel-btn {
    display: inline-block;
    margin: 10px 0;
    padding: 8px 20px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--soft-text, #9ea3b0);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
}
.aba-cancel-btn:hover { 
    color: #e1251b; 
}

/* ── Payment Success / Failed States ── */
.payment-success, .payment-failed { 
    padding: 28px; 
    border-radius: 16px; 
    text-align: center; 
    font-size: 1.1rem; 
    font-weight: 800; 
}
.payment-success { color: #145b31; background: #d9fce5; }
.payment-failed  { color: #8f1d29; background: #ffe5e8; }


/* ============================================
   Cancel Payment Confirm Dialog (Modal Overlay)
   ============================================ */
.cancel-confirm-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    background: rgba(5, 8, 16, 0.78) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    animation: confirmFadeIn 0.2s ease-out;
}
.cancel-confirm-overlay[hidden] {
    display: none !important;
}

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

.cancel-confirm-card {
    position: relative;
    background: #141722;
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 24px;
    padding: 34px 28px 26px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 35px rgba(255, 215, 0, 0.08);
    animation: confirmCardPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes confirmCardPop {
    from { opacity: 0; transform: scale(0.9) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Glowing Amber Warning Icon */
.cancel-confirm-icon-wrap {
    position: relative;
    width: 82px;
    height: 82px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cancel-confirm-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.38) 0%, rgba(255, 152, 0, 0) 70%);
    animation: iconGlowPulse 2.4s ease-in-out infinite;
}
@keyframes iconGlowPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.18); opacity: 1; }
}
.cancel-confirm-icon {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 26px rgba(245, 124, 0, 0.45);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.cancel-confirm-title {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.cancel-confirm-desc {
    font-size: 0.88rem;
    color: var(--soft-text, #9ea3b0);
    line-height: 1.55;
    margin: 0 0 26px;
}

.cancel-confirm-actions {
    display: flex;
    gap: 12px;
}

.cancel-confirm-stay {
    flex: 1;
    padding: 13px 18px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s ease;
}
.cancel-confirm-stay:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--gold, #ffd700);
    color: var(--gold, #ffd700);
}

.cancel-confirm-leave {
    flex: 1;
    padding: 13px 18px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #E1251B, #C2185B);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 6px 20px rgba(225, 37, 27, 0.38);
}
.cancel-confirm-leave:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(225, 37, 27, 0.55);
    opacity: 0.95;
}

/* ===== ABA Payment Success Card Modal ===== */
.aba-success-card {
    width: min(100%, 420px);
    margin: 10px auto 16px;
    text-align: center;
    animation: successFadeIn 0.35s ease-out;
}
.aba-success-card[hidden] {
    display: none !important;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.aba-success-badge-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aba-success-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0) 70%);
    animation: ringPulse 2s infinite ease-in-out;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

.aba-success-icon-box {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 2.5px solid #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.35);
}

.aba-success-title {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-size: 1.55rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.aba-success-sub {
    font-size: 0.90rem;
    color: var(--soft-text, #9ea3b0);
    margin: 0 0 20px;
    line-height: 1.5;
}
.aba-success-sub strong {
    color: var(--gold, #ffd700);
}

.aba-receipt-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 18px;
    margin-bottom: 18px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.aba-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
}
.aba-receipt-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}
.aba-receipt-row:first-child {
    padding-top: 2px;
}

.aba-receipt-label {
    color: #94a3b8;
    font-weight: 500;
}

.aba-receipt-val {
    color: #f1f5f9;
    font-weight: 700;
    text-align: right;
    word-break: break-all;
}

.aba-tag-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold, #ffd700);
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 0.72rem;
    font-weight: 800;
    margin-left: 6px;
    vertical-align: middle;
}

.aba-delivery-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: lowercase;
}
.aba-delivery-pill.queued {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.aba-delivery-pill.delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.aba-success-tip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 11px 14px;
    margin-bottom: 20px;
    font-size: 0.82rem;
    color: #f8fafc;
    text-align: left;
    line-height: 1.45;
}
.aba-success-tip svg {
    flex-shrink: 0;
    color: var(--gold, #ffd700);
}
.aba-success-tip code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gold, #ffd700);
    font-weight: 700;
}

.aba-success-close-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

