/* Tasnim Wallet — frontend styles (RTL). Mirrors frontend.css — logical properties handle direction. */

/* ---- Header: balance card + tabs ---- */

.tsnw-balance-card {
	background: linear-gradient( 135deg, #4f46a5 0%, #7f54b3 100% );
	border-radius: 14px;
	color: #fff;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-block-end: 16px;
	padding: 26px 30px;
	position: relative;
	box-shadow: 0 8px 24px rgba( 79, 70, 165, 0.25 );
}

.tsnw-balance-card.is-locked {
	background: linear-gradient( 135deg, #6b7280 0%, #9ca3af 100% );
	box-shadow: none;
}

.tsnw-balance-card__label {
	font-size: 13px;
	opacity: 0.85;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tsnw-balance-card__amount {
	font-size: 32px;
	font-weight: 700;
	line-height: 1.2;
}

.tsnw-balance-card__amount .woocommerce-Price-amount {
	color: #fff;
}

.tsnw-balance-card__lock {
	background: rgba( 0, 0, 0, 0.25 );
	border-radius: 20px;
	font-size: 12px;
	inset-block-start: 16px;
	inset-inline-end: 16px;
	padding: 4px 12px;
	position: absolute;
}

.tsnw-wallet-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-block-end: 22px;
}

.tsnw-wallet-tab {
	background: #f3f2f8;
	border: 1px solid #e3e0ee;
	border-radius: 24px;
	color: inherit;
	font-size: 0.95em;
	padding: 8px 18px;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.tsnw-wallet-tab:hover {
	background: #e9e6f5;
	text-decoration: none;
}

.tsnw-wallet-tab.is-active {
	background: #4f46a5;
	border-color: #4f46a5;
	color: #fff;
}

/* ---- Overview stats ---- */

.tsnw-stats {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
	margin-block-end: 26px;
}

.tsnw-stat {
	background: #fbfaff;
	border: 1px solid #eceaf5;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
}

.tsnw-stat__icon {
	font-size: 18px;
	line-height: 1;
}

.tsnw-stat__icon--topup {
	color: #0f8a3c;
}

.tsnw-stat__icon--spent {
	color: #cc1818;
}

.tsnw-stat__icon--cashback {
	color: #b45309;
}

.tsnw-stat__value {
	font-size: 18px;
	font-weight: 700;
}

.tsnw-stat__label {
	color: #767676;
	font-size: 12px;
}

.tsnw-section-head {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: space-between;
	margin-block-end: 10px;
}

.tsnw-section-head h3 {
	margin: 0;
}

.tsnw-link {
	font-size: 0.9em;
}

/* ---- Transactions table ---- */

.tsnw-transactions-table {
	border: 1px solid #eceaf5;
	border-collapse: separate;
	border-radius: 12px;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
}

.tsnw-transactions-table th,
.tsnw-transactions-table td {
	border: 0;
	border-block-start: 1px solid #f0eef7;
	padding: 12px 14px;
	text-align: start;
	vertical-align: middle;
}

.tsnw-transactions-table thead th {
	background: #f7f6fb;
	border-block-start: 0;
	color: #555;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.tsnw-transactions-table tbody tr:nth-child( even ) td {
	background: #fbfaff;
}

.tsnw-transactions-table small {
	color: #767676;
	display: block;
	margin-block-start: 3px;
}

.tsnw-time {
	color: #999;
	font-size: 0.85em;
}

.tsnw-amount--credit {
	color: #0f8a3c;
	font-weight: 600;
	white-space: nowrap;
}

.tsnw-amount--debit {
	color: #cc1818;
	font-weight: 600;
	white-space: nowrap;
}

/* Category badges */

.tsnw-badge {
	background: #eef1f5;
	border-radius: 14px;
	color: #444;
	display: inline-block;
	font-size: 12px;
	line-height: 1.6;
	padding: 2px 10px;
	white-space: nowrap;
}

.tsnw-badge--topup,
.tsnw-badge--refund,
.tsnw-badge--transfer_in {
	background: #e7f7ec;
	color: #0f8a3c;
}

.tsnw-badge--purchase,
.tsnw-badge--partial_payment,
.tsnw-badge--transfer_out,
.tsnw-badge--transfer_fee {
	background: #fdeeee;
	color: #cc1818;
}

.tsnw-badge--cashback {
	background: #fdf3e7;
	color: #b45309;
}

.tsnw-badge--adjustment,
.tsnw-badge--migration {
	background: #ede9fb;
	color: #4f46a5;
}

.tsnw-badge--cashback_expired {
	background: #f1f1f1;
	color: #777;
}

/* Cashback expiry note */

.tsnw-expiry {
	color: #b45309;
	display: block;
	font-size: 0.85em;
	margin-block-start: 3px;
}

.tsnw-expiry--expired {
	color: #999;
	text-decoration: line-through;
}

/* ---- Empty state ---- */

.tsnw-empty {
	background: #fbfaff;
	border: 1px dashed #d9d4ec;
	border-radius: 12px;
	color: #767676;
	padding: 36px 20px;
	text-align: center;
}

.tsnw-empty__icon {
	display: block;
	font-size: 30px;
	margin-block-end: 8px;
}

.tsnw-empty p {
	margin: 0;
}

/* ---- Forms (top-up / transfer) ---- */

.tsnw-panel {
	background: #fbfaff;
	border: 1px solid #eceaf5;
	border-radius: 12px;
	padding: 22px 24px;
}

.tsnw-form {
	max-width: 480px;
}

.tsnw-form .form-row {
	margin-block-end: 14px;
}

.tsnw-form label {
	display: block;
	font-weight: 600;
	margin-block-end: 4px;
}

.tsnw-form .input-text {
	width: 100%;
}

.tsnw-hint {
	color: #767676;
	font-size: 0.9em;
}

.tsnw-submit {
	min-width: 180px;
}

/* Quick-amount chips */

.tsnw-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-end: 16px;
}

.tsnw-chip {
	background: #fff;
	border: 1px solid #d9d4ec;
	border-radius: 22px;
	cursor: pointer;
	font-size: 0.92em;
	padding: 7px 16px;
	transition: all 0.15s ease;
}

.tsnw-chip:hover {
	border-color: #4f46a5;
}

.tsnw-chip.is-selected {
	background: #4f46a5;
	border-color: #4f46a5;
	color: #fff;
}

.tsnw-chip.is-selected .woocommerce-Price-amount {
	color: #fff;
}

/* Transfer fee preview */

.tsnw-fee-preview {
	background: #fff;
	border: 1px solid #eceaf5;
	border-radius: 10px;
	margin-block-end: 14px;
	padding: 12px 16px;
}

.tsnw-fee-preview__row {
	display: flex;
	justify-content: space-between;
	padding-block: 4px;
}

.tsnw-fee-preview__row--total {
	border-block-start: 1px dashed #e3e0ee;
	font-weight: 700;
	margin-block-start: 4px;
	padding-block-start: 8px;
}

/* ---- Pagination ---- */

.tsnw-pagination {
	margin-block: 18px;
	text-align: center;
}

.tsnw-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tsnw-pagination .page-numbers li {
	margin: 0;
}

.tsnw-pagination a.page-numbers,
.tsnw-pagination span.page-numbers {
	background: #f3f2f8;
	border: 1px solid #e3e0ee;
	border-radius: 8px;
	display: inline-block;
	min-width: 38px;
	padding: 7px 10px;
	text-align: center;
	text-decoration: none;
}

.tsnw-pagination a.page-numbers:hover {
	background: #e9e6f5;
}

.tsnw-pagination span.page-numbers.current {
	background: #4f46a5;
	border-color: #4f46a5;
	color: #fff;
}

.tsnw-pagination__info {
	color: #999;
	font-size: 0.85em;
	margin-block-start: 8px;
}

/* ---- Misc ---- */

.tsnw-partial-payment {
	background: #f7f6fb;
	border: 1px solid #e3e0ee;
	border-radius: 8px;
	margin-block-end: 16px;
	padding: 12px 16px;
}

.tsnw-partial-payment label {
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.tsnw-mini-wallet a {
	white-space: nowrap;
}

.tsnw-gateway-balance {
	font-weight: 600;
	margin-block-start: 6px;
}

/* Wallet gateway icon at checkout */
.payment_method_tasnim_wallet img {
	margin-inline-start: 8px;
	max-height: 28px;
	vertical-align: middle;
}

/* ---- Mobile: stack the table into cards ---- */

@media ( max-width: 640px ) {
	.tsnw-transactions-table thead {
		display: none;
	}

	.tsnw-transactions-table,
	.tsnw-transactions-table tbody,
	.tsnw-transactions-table tr,
	.tsnw-transactions-table td {
		display: block;
		width: 100%;
	}

	.tsnw-transactions-table tr {
		border-block-end: 6px solid #f3f2f8;
	}

	.tsnw-transactions-table td {
		border: 0;
		display: flex;
		gap: 12px;
		justify-content: space-between;
		padding: 8px 14px;
	}

	.tsnw-transactions-table td::before {
		color: #767676;
		content: attr( data-label );
		font-size: 0.85em;
	}

	.tsnw-balance-card {
		padding: 20px 22px;
	}

	.tsnw-balance-card__amount {
		font-size: 26px;
	}

	.tsnw-panel {
		padding: 16px;
	}
}
