/**
 * WSP Referral Wallet for WooCommerce Styles
 */

/* ====================================================================
   FRONTEND MY ACCOUNT DASHBOARD
   ==================================================================== */
.wsp-my-account-dashboard {
	margin: 20px 0;
	font-family: inherit;
}

/* Tab Navigation */
.wsp-tabs-nav {
	display: flex;
	gap: 5px;
	border-bottom: 2px solid #e2e8f0;
	margin-bottom: 25px;
	padding-bottom: 0;
	flex-wrap: wrap;
}

.wsp-tab-btn {
	background: none !important;
	border: none !important;
	border-bottom: 3px solid transparent !important;
	color: #64748b !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	padding: 12px 20px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	margin-bottom: -2px !important;
}

.wsp-tab-btn:hover {
	color: #1e293b !important;
	border-bottom-color: #cbd5e1 !important;
}

.wsp-tab-btn.active {
	color: #2563eb !important;
	border-bottom-color: #2563eb !important;
}

.wsp-tab-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
}

.wsp-tab-panel {
	display: none;
	animation: wspFadeIn 0.3s ease;
}

.wsp-tab-panel.active {
	display: block;
}

@keyframes wspFadeIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Card Stats Grid */
.wsp-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.wsp-stat-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wsp-stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.wsp-balance-card {
	border-left: 4px solid #3b82f6;
}

.wsp-stat-label {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.wsp-stat-value {
	font-size: 26px;
	font-weight: 700;
	color: #1e293b;
}

.wsp-code-display {
	font-family: monospace;
	letter-spacing: 1px;
	color: #2563eb;
}

.wsp-stat-sub {
	margin-top: 10px;
	font-size: 12px;
	color: #94a3b8;
}

.status-indicator {
	font-weight: 600;
}

.status-indicator.pending {
	color: #d97706;
}

.status-indicator.approved {
	color: #16a34a;
}

/* Share Referral Box */
.wsp-referral-link-box {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	padding: 25px;
	margin-bottom: 40px;
}

.wsp-referral-link-box h4 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 18px;
	color: #1e293b;
}

.wsp-copy-link-group {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

.wsp-copy-link-group input[type="text"] {
	flex-grow: 1;
	height: 44px !important;
	padding: 10px 15px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	background: #ffffff !important;
	color: #475569 !important;
	font-size: 14px !important;
	outline: none !important;
	box-sizing: border-box !important;
}

.wsp-copy-link-group button {
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background-color: #f1f5f9 !important;
	border: 1px solid #cbd5e1 !important;
	transition: all 0.2s ease !important;
	color: #475569 !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
}

.wsp-copy-link-group button:hover {
	background-color: #e2e8f0 !important;
	border-color: #94a3b8 !important;
	color: #1e293b !important;
}

.wsp-copy-link-group button.copied {
	background-color: #d1fae5 !important;
	border-color: #10b981 !important;
	color: #065f46 !important;
}

.wsp-copy-link-group button .dashicons {
	font-size: 20px !important;
	width: 20px !important;
	height: 20px !important;
	line-height: 20px !important;
}

/* Sections */
.wsp-dashboard-section {
	margin-bottom: 40px;
}

.wsp-dashboard-section h3 {
	font-size: 20px;
	margin-bottom: 15px;
	color: #1e293b;
}

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

.wsp-section-header h3 {
	margin-bottom: 0;
}

.wsp-tx-search-form {
	display: flex;
	gap: 8px;
}

.wsp-tx-search-form input[type="text"] {
	padding: 6px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
}

.wsp-no-records {
	color: #94a3b8;
	font-style: italic;
}

/* Records Table */
.wsp-records-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
}

.wsp-records-table th,
.wsp-records-table td {
	padding: 14px 16px;
	text-align: left;
}

.wsp-records-table th {
	background: #f1f5f9;
	color: #475569;
	font-weight: 600;
}

/* Status Badges */
.wsp-status-tag {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
}

.wsp-status-tag.status-pending {
	background: #fef3c7;
	color: #d97706;
}

.wsp-status-tag.status-approved,
.wsp-status-tag.status-paid {
	background: #d1fae5;
	color: #065f46;
}

.wsp-status-tag.status-rejected,
.wsp-status-tag.status-cancelled {
	background: #fee2e2;
	color: #991b1b;
}

/* Transaction Types */
.wsp-tx-type {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}

.wsp-tx-type.tag-credit {
	background: #e0f2fe;
	color: #0369a1;
}

.wsp-tx-type.tag-debit {
	background: #ffedd5;
	color: #c2410c;
}

.wsp-amount-val {
	font-weight: 700;
}

.wsp-amount-val.credit {
	color: #15803d;
}

.wsp-amount-val.debit {
	color: #b91c1c;
}

.wsp-pagination {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

/* ====================================================================
   CHECKOUT WALLET INTEGRATION
   ==================================================================== */
.wsp-checkout-wallet-wrapper {
	background: #ffffff;
	border: 1px solid #dcdcdc;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.wsp-wallet-checkbox-label {
	display: flex !important;
	align-items: center !important;
	gap: 10px !important;
	cursor: pointer !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	color: #1e293b !important;
	user-select: none !important;
	transition: color 0.2s ease !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.5 !important;
}

.wsp-wallet-checkbox-label:hover {
	color: #2563eb !important;
}

#wsp-wallet-checkbox {
	width: 18px !important;
	height: 18px !important;
	cursor: pointer !important;
	margin: 0 !important;
	accent-color: #2563eb !important;
}

.wsp-wallet-checkbox-text {
	display: flex !important;
	align-items: center !important;
	gap: 6px !important;
}

.wsp-wallet-icon {
	font-size: 20px !important;
	width: 20px !important;
	height: 20px !important;
	line-height: 20px !important;
	display: inline-block !important;
	color: #64748b !important;
}

/* ====================================================================
   ADMIN PANELS STYLING
   ==================================================================== */
.wsp-admin-wrap {
	margin-top: 20px;
	padding-right: 20px;
}

.wsp-admin-page-title {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 20px;
}

/* KPI Cards Grid */
.wsp-admin-kpis-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin-bottom: 30px;
}

.wsp-kpi-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wsp-kpi-icon {
	font-size: 28px;
	width: 28px;
	height: 28px;
	line-height: 28px;
	background: #f1f5f9;
	padding: 10px;
	border-radius: 8px;
	color: #475569;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wsp-kpi-details {
	display: flex;
	flex-direction: column;
}

.wsp-kpi-title {
	font-size: 12px;
	color: #64748b;
	font-weight: 600;
	text-transform: uppercase;
}

.wsp-kpi-value {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
	margin: 4px 0;
}

.wsp-kpi-sub {
	font-size: 11px;
	color: #94a3b8;
}

/* Charts and Sections */
.wsp-admin-charts-section {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 30px;
}

@media (max-width: 782px) {
	.wsp-admin-charts-section {
		grid-template-columns: 1fr;
	}
}

.wsp-chart-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wsp-chart-card h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #1e293b;
}

.wsp-svg-funnel-chart {
	height: 200px;
	display: flex;
	justify-content: center;
}

/* Adjustments forms */
.wsp-wallet-manager-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 782px) {
	.wsp-wallet-manager-grid {
		grid-template-columns: 1fr;
	}
}

.wsp-admin-form-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 25px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wsp-admin-form-card h3 {
	margin-top: 0;
	margin-bottom: 20px;
}

.wsp-danger-text {
	color: #b91c1c;
	font-weight: 600;
}

.wsp-admin-lists-section {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

@media (max-width: 782px) {
	.wsp-admin-lists-section {
		grid-template-columns: 1fr;
	}
}

.wsp-admin-table-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
}

.wsp-customer-email {
	color: #64748b;
	font-size: 11px;
}

.wsp-customer-link-input {
	width: 100%;
	font-size: 11px !important;
	background: #f1f5f9 !important;
}

.wsp-admin-copy-link-wrapper {
	display: flex;
	gap: 6px;
	align-items: center;
	width: 100%;
}

.wsp-admin-copy-link-wrapper input[type="text"].wsp-customer-link-input {
	flex: 1;
	min-width: 50px;
	text-overflow: ellipsis;
	margin: 0 !important;
}

.wsp-admin-copy-btn {
	white-space: nowrap;
}

.wsp-bulk-row {
	margin-bottom: 10px;
}

.wsp-table-wrapper {
	width: 100%;
	overflow-x: auto;
	margin-bottom: 20px;
	-webkit-overflow-scrolling: touch;
}

/* Custom self-contained table styling to bypass theme overrides */
.wsp-dashboard-table {
	width: 100% !important;
	border-collapse: collapse !important;
	margin: 15px 0 25px 0 !important;
	background: #ffffff !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 8px !important;
	overflow: hidden !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
	display: table !important;
}

.wsp-dashboard-table thead {
	display: table-header-group !important;
}

.wsp-dashboard-table tbody {
	display: table-row-group !important;
}

.wsp-dashboard-table tr {
	display: table-row !important;
}

.wsp-dashboard-table th,
.wsp-dashboard-table td {
	padding: 14px 18px !important;
	text-align: left !important;
	vertical-align: middle !important;
	border-bottom: 1px solid #e2e8f0 !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	display: table-cell !important;
}

.wsp-dashboard-table th {
	background-color: #f8fafc !important;
	color: #475569 !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	font-size: 12px !important;
	letter-spacing: 0.5px !important;
	border-bottom: 2px solid #e2e8f0 !important;
}

.wsp-dashboard-table tr:last-child td {
	border-bottom: none !important;
}

.wsp-dashboard-table tr:hover td {
	background-color: #f8fafc !important;
}



