/* Tăng Tương Tác - Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

.ttb-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;
}

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

/* Notice */
.ttb-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;
}
.ttb-notice-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* Form Box */
.ttb-form-box { padding: 24px 24px 28px; }

/* Fields */
.ttb-field { margin-bottom: 14px; }
.ttb-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ttb-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.ttb-field-hint { margin: 6px 0 0; font-size: 0.76rem; color: #94a3b8; }
.ttb-field-hint.ttb-hint-warn { color: #b91c1c; font-weight: 600; }

.ttb-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;
}
.ttb-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

/* Native select (Nền tảng / Dịch vụ) — ép override CSS theme có thể xung đột */
select.ttb-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 (Tổng tiền) */
.ttb-result-box {
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border: 2px solid #ddd6fe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}
.ttb-result-label { font-size: 0.78rem; color: #6b7280; font-weight: 500; margin-bottom: 4px; }
.ttb-result-value { font-size: 1.7rem; font-weight: 700; color: #6d28d9; letter-spacing: -0.5px; }

/* Submit Button */
.ttb-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    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;
}
.ttb-submit-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #be185d);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}
.ttb-submit-btn:active { transform: translateY(0); }

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

/* Modal */
.ttb-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);
}
.ttb-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: ttbModalIn 0.3s ease;
}
@keyframes ttbModalIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}
.ttb-modal-icon { font-size: 3rem; margin-bottom: 12px; }
.ttb-modal-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.ttb-modal-msg { margin: 0 0 20px; color: #64748b; font-size: 0.9rem; line-height: 1.6; }
.ttb-order-display {
    background: #faf5ff;
    border: 2px dashed #ddd6fe;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.ttb-order-label { font-size: 0.78rem; color: #6b7280; display: block; margin-bottom: 6px; font-weight: 600; }
.ttb-order-code {
    font-size: 1.4rem;
    font-weight: 700;
    color: #6d28d9;
    letter-spacing: 2px;
    font-family: monospace;
    margin-bottom: 10px;
}
.ttb-copy-btn {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    color: #6d28d9;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.2s;
}
.ttb-copy-btn:hover { background: #ede9fe; }

/* Payment Info Box (trong modal thành công) */
.ttb-payment-box {
    background: #fffbeb;
    border: 2px solid #fde68a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}
.ttb-payment-title { font-size: 0.85rem; font-weight: 700; color: #92400e; margin-bottom: 10px; text-align: center; }
.ttb-payment-qr {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 14px;
    border-radius: 8px;
    border: 1px solid #fde68a;
}
.ttb-payment-lines { font-size: 0.85rem; color: #78350f; line-height: 1.7; }
.ttb-payment-note { margin-top: 6px; font-weight: 700; color: #92400e; }

.ttb-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;
    transition: background 0.2s;
}
.ttb-modal-close:hover { background: #e2e8f0; }

/* Order Lookup */
.ttb-lookup-box {
    padding: 20px 24px 28px;
    border-top: 1px solid #f1f5f9;
}
.ttb-lookup-title { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.ttb-lookup-row { display: flex; gap: 8px; margin-bottom: 14px; }
.ttb-lookup-row .ttb-input { flex: 1; }
.ttb-lookup-btn {
    flex-shrink: 0;
    padding: 11px 18px;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.ttb-lookup-btn:hover { background: #0f172a; }
.ttb-lookup-results { display: flex; flex-direction: column; gap: 8px; }
.ttb-lookup-empty { text-align: center; color: #94a3b8; font-size: 0.85rem; padding: 12px 0; }
.ttb-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
}
.ttb-order-row-main { display: flex; flex-direction: column; gap: 2px; }
.ttb-order-row-code { font-family: monospace; font-weight: 700; color: #1e293b; font-size: 0.85rem; }
.ttb-order-row-detail { font-size: 0.78rem; color: #64748b; }
.ttb-order-row-price { font-size: 0.85rem; font-weight: 700; color: #6d28d9; white-space: nowrap; }
.ttb-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.ttb-status-pending   { background: #fef3c7; color: #92400e; }
.ttb-status-processing{ background: #dbeafe; color: #1e40af; }
.ttb-status-completed { background: #d1fae5; color: #065f46; }
.ttb-status-cancelled { background: #fee2e2; color: #991b1b; }

@media (max-width: 480px) {
    .ttb-field-row { grid-template-columns: 1fr; }
    .ttb-lookup-row { flex-direction: column; }
}

/* Currency Toggle */
.ttb-currency-toggle { display: flex; gap: 8px; }
.ttb-cur-btn {
    flex: 1; padding: 11px; border: 2px solid #e2e8f0; border-radius: 10px;
    background: #fff; color: #64748b; font-size: 0.9rem; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.ttb-cur-btn:hover { border-color: #c4b5fd; }
.ttb-cur-btn.active { border-color: #7c3aed; background: #f5f3ff; color: #6d28d9; }

/* Ô ghi chú khách trên form */
.ttb-textarea { resize: vertical; min-height: 70px; font-family: inherit; line-height: 1.5; }
