/* Nạp Game - Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

.tgn-wrapper {
    font-family: 'Be Vietnam Pro', sans-serif;
    max-width: 560px;
    margin: 30px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    background: #fff;
}

.tgn-header {
    background: linear-gradient(135deg, #2f6bff 0%, #38bdf8 100%);
    padding: 30px 20px 24px;
    text-align: center;
    color: #fff;
}
.tgn-icon-row { font-size: 2.2rem; margin-bottom: 8px; }
.tgn-title { margin: 0 0 4px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.3px; }
.tgn-subtitle { margin: 0; font-size: 0.9rem; opacity: 0.85; }

.tgn-notice {
    display: flex; align-items: flex-start; gap: 10px;
    background: #fffbeb; border-left: 4px solid #f59e0b;
    padding: 12px 16px; font-size: 0.875rem; color: #92400e; line-height: 1.5;
}
.tgn-notice-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

.tgn-form-box { padding: 24px 24px 28px; }
.tgn-field { margin-bottom: 14px; }
.tgn-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tgn-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 6px; }

.tgn-input {
    width: 100%; padding: 11px 14px; border: 2px solid #e2e8f0; border-radius: 10px;
    font-size: 0.95rem; font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box; color: #1e293b; background: #fff;
}
.tgn-input:focus { outline: none; border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47,107,255,0.15); }

select.tgn-select {
    appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important;
    height: auto !important; line-height: 1.4 !important; min-height: 0 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.293l3.71-4.06a.75.75 0 111.08 1.04l-4.25 4.65a.75.75 0 01-1.08 0l-4.25-4.65a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    padding: 11px 36px 11px 14px !important; cursor: pointer; color: #1e293b;
}

/* Result Box: giá gốc / chiết khấu / thành tiền */
.tgn-result-box {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 2px solid #bfdbfe; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.tgn-result-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.86rem; color: #475569; padding: 3px 0; }
.tgn-result-original s { color: #94a3b8; }
.tgn-result-discount { color: #dc2626; font-weight: 600; }
.tgn-result-total { border-top: 1px dashed #bfdbfe; margin-top: 6px; padding-top: 9px; font-size: 0.92rem; font-weight: 600; color: #1e293b; }
.tgn-result-final { font-size: 1.5rem; font-weight: 700; color: #1d4ed8; letter-spacing: -0.5px; }

/* Cổng thanh toán */
.tgn-gateways { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tgn-gateway-group { grid-column: 1 / -1; font-size: 0.78rem; font-weight: 700; color: #475569; margin-top: 4px; }
.tgn-gateway-group:first-child { margin-top: 0; }
.tgn-gateway-item {
    display: flex; align-items: center; gap: 7px; padding: 9px 11px; min-width: 0;
    border: 2px solid #e2e8f0; border-radius: 10px; background: #fff; cursor: pointer;
    font-family: inherit; font-size: 0.83rem; color: #1e293b; text-align: left; transition: all 0.15s;
}
.tgn-gateway-item:hover { border-color: #93c5fd; background: #f8fafc; }
.tgn-gateway-item.active { border-color: #2f6bff; background: #eff6ff; box-shadow: 0 0 0 3px rgba(47,107,255,0.12); }
.tgn-gateway-icon { font-size: 1.05rem; flex-shrink: 0; }
.tgn-gateway-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgn-gateway-empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; font-size: 0.85rem; padding: 12px; }

.tgn-textarea { resize: vertical; min-height: 56px; line-height: 1.5; }

.tgn-submit-btn {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #2f6bff, #38bdf8); color: #fff;
    border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; font-family: inherit;
    cursor: pointer; margin-top: 8px; transition: all 0.2s; letter-spacing: 0.2px;
}
.tgn-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(47,107,255,0.35); }
.tgn-submit-btn:active { transform: translateY(0); }

.tgn-error {
    margin: 0 24px 20px; padding: 12px 16px; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 10px; color: #b91c1c; font-size: 0.875rem;
}

/* Modal */
.tgn-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.tgn-modal-content { background: #fff; border-radius: 20px; padding: 36px 32px; text-align: center; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: tgnModalIn 0.3s ease; max-height: 90vh; overflow-y: auto; }
@keyframes tgnModalIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.tgn-modal-icon { font-size: 3rem; margin-bottom: 12px; }
.tgn-modal-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.tgn-modal-msg { margin: 0 0 20px; color: #64748b; font-size: 0.9rem; line-height: 1.6; }
.tgn-order-display { background: #f0f9ff; border: 2px dashed #bfdbfe; border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.tgn-order-label { font-size: 0.78rem; color: #6b7280; display: block; margin-bottom: 6px; font-weight: 600; }
.tgn-order-code { font-size: 1.4rem; font-weight: 700; color: #1d4ed8; letter-spacing: 2px; font-family: monospace; margin-bottom: 10px; }
.tgn-copy-btn { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; padding: 6px 16px; border-radius: 8px; font-size: 0.82rem; cursor: pointer; font-family: inherit; font-weight: 600; }
.tgn-copy-btn:hover { background: #dbeafe; }

.tgn-payment-box { background: #fffbeb; border: 2px solid #fde68a; border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: left; }
.tgn-payment-title { font-size: 0.85rem; font-weight: 700; color: #92400e; margin-bottom: 10px; text-align: center; }
.tgn-payment-qr { display: block; width: 100%; max-width: 220px; margin: 0 auto 14px; border-radius: 8px; border: 1px solid #fde68a; }
.tgn-payment-lines { font-size: 0.85rem; color: #78350f; line-height: 1.7; word-break: break-word; }
.tgn-payment-note { margin-top: 6px; font-weight: 700; color: #92400e; }
.tgn-payment-instructions { margin-top: 6px; color: #92400e; font-style: italic; }

.tgn-modal-close { background: #f1f5f9; border: none; color: #475569; padding: 10px 28px; border-radius: 10px; font-size: 0.9rem; cursor: pointer; font-family: inherit; font-weight: 600; }
.tgn-modal-close:hover { background: #e2e8f0; }

/* Lookup */
.tgn-lookup-box { padding: 20px 24px 28px; border-top: 1px solid #f1f5f9; }
.tgn-lookup-title { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.tgn-lookup-desc { font-size: 0.8rem; color: #64748b; line-height: 1.5; margin: 0 0 14px; }
.tgn-lookup-row { display: flex; gap: 8px; margin-bottom: 14px; }
.tgn-lookup-row .tgn-input { flex: 1; }
.tgn-lookup-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0) 55%), var(--tgn-primary, #2f6bff);
    color: #fff;
    border: none;
    border-radius: var(--tgn-radius, 10px);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.tgn-lookup-btn::before { content: "🔍"; font-size: 0.95em; line-height: 1; }
.tgn-lookup-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0,0,0,0.22); }
.tgn-lookup-btn:active { transform: translateY(0); box-shadow: 0 3px 9px rgba(0,0,0,0.18); }
.tgn-lookup-btn-full { display: flex; width: 100%; margin-top: 12px; padding: 13px; font-size: 0.95rem; }
.tgn-lookup-msg { display: none; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 9px 12px; font-size: 0.8rem; line-height: 1.5; margin-top: 12px; }
.tgn-lookup-results { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tgn-lookup-empty { text-align: center; color: #94a3b8; font-size: 0.85rem; padding: 12px 0; }
.tgn-order-row { display: flex; flex-direction: column; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; }
.tgn-order-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tgn-order-row-main { display: flex; flex-direction: column; gap: 2px; }
.tgn-order-row-code { font-family: monospace; font-weight: 700; color: #1e293b; font-size: 0.9rem; }
.tgn-order-row-detail { font-size: 0.78rem; color: #64748b; }
.tgn-order-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tgn-order-row-price { font-size: 0.85rem; font-weight: 700; color: #1d4ed8; white-space: nowrap; }
.tgn-order-info { display: flex; flex-direction: column; gap: 5px; border-top: 1px dashed #e2e8f0; padding-top: 8px; }
.tgn-order-info-line { display: flex; gap: 8px; font-size: 0.78rem; line-height: 1.5; }
.tgn-order-info-label { flex-shrink: 0; min-width: 70px; color: #94a3b8; font-weight: 600; }
.tgn-order-info-value { color: #475569; word-break: break-word; }
.tgn-order-msg { margin-top: 2px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; color: #065f46; line-height: 1.5; }
.tgn-status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.tgn-status-pending { background: #fef3c7; color: #92400e; }
.tgn-status-processing { background: #dbeafe; color: #1e40af; }
.tgn-status-completed { background: #d1fae5; color: #065f46; }
.tgn-status-cancelled { background: #fee2e2; color: #991b1b; }

@media (max-width: 480px) {
    .tgn-field-row { grid-template-columns: 1fr; }
    .tgn-gateways { grid-template-columns: 1fr 1fr; }
}
