/* ==========================================
   Topup ProCredit - White & Gold Luxury Theme
   ========================================== */

.topup-body {
    background-color: #faf9f6;
    color: #333333;
    font-family: 'Prompt', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.luxury-header {
    background: #ffffff;
    border-bottom: 2px solid #f1e5c8;
    padding: 14px 0;
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container.nav-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.luxury-header .logo a {
    color: #b8860b;
    font-size: 1.45rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.luxury-header .gold-badge {
    background: linear-gradient(135deg, #dfac6c 0%, #b8860b 100%);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-back {
    color: #ffffff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: 1px solid #b8860b;
    padding: 9px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
}

.topup-container {
    max-width: 650px;
    margin: 30px auto;
    padding: 0 15px;
}

.topup-card-luxury {
    background: #ffffff;
    border: 1px solid #f1e5c8;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(184, 134, 11, 0.1);
    position: relative;
}

.topup-header-title h2 {
    color: #b8860b;
    font-size: 1.6rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credit-display-box {
    background: linear-gradient(135deg, #fffdf5 0%, #fef7e0 100%);
    border: 1px solid #d4af37;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
}

.gold-credit-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: #b8860b;
    margin: 8px 0 0 0;
}

.topup-packages-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 12px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.package-card {
    background: #faf9f6;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-card h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: #333;
}

.package-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #b8860b;
    font-weight: 600;
}

.package-card.active {
    border-color: #b8860b;
    background: #fff8e8;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.2);
}

.qr-section {
    background: #faf9f6;
    border: 1px solid #f1e5c8;
    border-radius: 14px;
    padding: 25px 20px;
    margin-top: 20px;
}

.qr-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.timer-box.timer-top {
    margin-bottom: 15px;
    font-size: 0.95rem;
    padding: 8px 18px;
    background: #fff8e8;
    border: 1px solid #f1e5c8;
    color: #b8860b;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.timer-box.timer-top strong {
    color: #e65100;
}

.qr-image-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #d4af37;
    margin-bottom: 5px;
}

.qr-image-wrapper img {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.custom-upload-btn {
    background: #ffffff;
    border: 2px dashed #d4af37;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #555;
}

.custom-upload-btn.upload-success {
    border-color: #10b981;
    background: #f0fdf4;
    color: #047857;
}

.btn-gold-payment {
    width: 100%;
    background: linear-gradient(135deg, #dfac6c 0%, #b8860b 100%);
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    background: #ccc !important;
    box-shadow: none !important;
}

/* ==========================================
   Toast แจ้งเตือนกลางจอเป๊ะๆ (อิงจุดตัดเส้นสีม่วง & กรอบสีแดง)
   ========================================== */
.card-modal-overlay {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 480px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    z-index: 999999 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 24px;
    border: 3px solid #d4af37;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 30px rgba(212, 175, 55, 0.3);
    padding: 35px 30px;
    box-sizing: border-box;
    animation: zoomInScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.center-toast-box {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.toast-icon-warning-lg {
    font-size: 3.5rem;
    margin-bottom: 8px;
}

.toast-title-danger-lg, 
.toast-title-success, 
.toast-title-warning {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.toast-title-danger-lg { color: #dc2626; }
.toast-title-success { color: #b8860b; }
.toast-title-warning { color: #d97706; }

.toast-text-body, 
.toast-text-body-lg {
    font-size: 1.15rem;
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 12px;
}

.toast-countdown-sub-lg {
    font-size: 0.95rem;
    color: #4b5563;
    background: #fef2f2;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #fecaca;
}

.animated-number {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 15px 0 25px 0;
    transition: color 0.3s ease;
}

.green-text { color: #10b981 !important; }
.black-text { color: #111827 !important; }

.toast-btn-action, 
.toast-btn-contact, 
.toast-btn-cancel {
    background: linear-gradient(135deg, #dfac6c 0%, #b8860b 100%);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-family: 'Prompt', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
    transition: all 0.2s ease;
}

.toast-actions-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.toast-btn-cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.btn-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #e5e7eb !important;
    color: #9ca3af !important;
}

/* Toast เล็กมุมขวาบน */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.custom-toast-normal {
    min-width: 260px;
    max-width: 380px;
    background: #ffffff;
    color: #1f2937;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: auto;
    border: 1px solid #f1e5c8;
    animation: slideInRight 0.35s ease forwards;
}

.custom-toast-normal.success { border-left: 6px solid #10b981; }
.custom-toast-normal.error { border-left: 6px solid #ef4444; }
.custom-toast-normal.warning { border-left: 6px solid #f59e0b; }

/* ตารางประวัติ */
.topup-history-section {
    border-top: 2px dashed #f1e5c8;
    padding-top: 25px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #b8860b;
}

.btn-refresh-history {
    background: #ffffff;
    border: 1px solid #d4af37;
    color: #b8860b;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.history-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #f1e5c8;
    background: #ffffff;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    background: #fffdf5;
    color: #b8860b;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #f1e5c8;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #f9f9f9;
    color: #444;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-approved { background-color: #d1fae5; color: #047857; }

/* Animation โหลดโลโก้ */
.logo-anim-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-anim-box { text-align: center; }

.spinning-logo-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 20px auto;
    animation: spinLogo 1.5s linear infinite;
}

.anim-logo-img { width: 100%; height: 100%; object-fit: contain; }

@keyframes spinLogo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes zoomInScale {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media screen and (max-width: 600px) {
    .card-modal-overlay {
        width: 92% !important;
        padding: 20px 15px !important;
    }
    .toast-actions-row {
        flex-direction: column;
        gap: 10px;
    }
    .toast-btn-contact, .toast-btn-cancel, .toast-btn-action {
        width: 100%;
    }
}

/* ปุ่มยกเลิกรายการ (สีเทา) */
.btn-cancel-payment {
    width: 100%;
    background: #e5e7eb;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Prompt', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.btn-cancel-payment:hover {
    background: #d1d5db;
    color: #1f2937;
}

/* ธีม Toast กลางจอ สไตล์เดียวกับหน้า Admin และ Payment */
.card-modal-overlay.interactive-toast {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 420px !important;
    background: linear-gradient(145deg, #ffffff 0%, #fffdf9 100%) !important;
    border: 2px solid #d4af37 !important;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25), 0 0 25px rgba(212, 175, 55, 0.2) !important;
    padding: 25px !important;
    text-align: center !important;
    z-index: 999999 !important;
    animation: zoomInScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast-line-1 {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
}

.toast-line-2 {
    font-size: 1.05rem;
    color: #333333;
    line-height: 1.5;
}

.toast-btn-yes, .toast-btn-no {
    flex: 1;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Prompt', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-btn-yes {
    background: linear-gradient(135deg, #dfac6c 0%, #b8860b 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.toast-btn-no {
    background: #f1f1f1;
    color: #555555;
    border: 1px solid #ccc;
}

.btn-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #e5e7eb !important;
    color: #9ca3af !important;
}
/* ฉากหลังเบลอและบล็อกการคลิกด้านหลังทั้งหมดสำหรับ Toast กลางจอทุกประเภท */
.card-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 999999 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    pointer-events: auto !important; /* ให้คลิกที่ Modal และปุ่มด้านในได้ปกติ */
}

/* กล่องเนื้อหา Toast ที่อยู่ตรงกลางจอ */
.card-modal-overlay.interactive-toast {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 420px !important;
    height: auto !important;
    background: linear-gradient(145deg, #ffffff 0%, #fffdf9 100%) !important;
    border: 2px solid #d4af37 !important;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25), 0 0 25px rgba(212, 175, 55, 0.2) !important;
    padding: 25px !important;
    text-align: center !important;
    animation: zoomInScale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
/* เมื่ออยู่ในสถานะล็อกแพ็กเกจ (หลังสร้าง QR) */
.package-grid.locked {
    pointer-events: none; /* ป้องกันการคลิกทุกกรณี */
}

.package-grid.locked .package-card {
    opacity: 0.35; /* ทำให้แพ็กเกจอื่นๆ จางลงอย่างเห็นได้ชัด */
    filter: grayscale(30%);
}

.package-grid.locked .package-card.active {
    opacity: 1 !important; /* ยกเว้นอันที่เลือกไว้ ให้คงความเด่นชัดเหมือนเดิม */
    filter: none;
    border-color: #b8860b !important;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}