/* WC Affiliate Dashboard — Premium Styles
 * Specificity boosted with .woocommerce-MyAccount-content to override theme styles.
 */

/* =============================================
   Global Dashboard
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-dashboard {
	max-width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	color: #2d3436;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Referral Link Section
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-referral-link-section {
	position: relative;
	margin-bottom: 30px;
	padding: 30px 28px 28px;
	background: #1a1a2e;
	border: none;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(26, 26, 46, 0.15);
	overflow: hidden;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #27ae60, #2ecc71, #27ae60);
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section h3 {
	margin: 0 0 4px 0;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	color: #fff !important;
	border: none;
	background: none;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section .description,
.woocommerce-MyAccount-content .wc-affiliate-referral-link-section p.description,
.woocommerce-MyAccount-content .wc-affiliate-referral-link-section p {
	color: rgba(255, 255, 255, 0.7) !important;
	margin: 0 0 20px 0;
	font-size: 13px;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-wrapper {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section input[type="text"].wc-affiliate-referral-input {
	flex: 1;
	min-width: 200px;
	padding: 13px 16px !important;
	font-size: 14px !important;
	font-weight: 500;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.07) !important;
	color: rgba(255, 255, 255, 0.85) !important;
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s, background 0.2s;
	height: auto !important;
	margin: 0;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section input[type="text"].wc-affiliate-referral-input:focus {
	border-color: rgba(39, 174, 96, 0.5);
	background: rgba(255, 255, 255, 0.1);
	box-shadow: none;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section button#wc-affiliate-copy-btn {
	padding: 13px 26px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	border: none;
	border-radius: 10px;
	background: #27ae60;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
	white-space: nowrap;
	line-height: normal;
	height: auto;
	margin: 0;
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section button#wc-affiliate-copy-btn:hover {
	background: #2ecc71;
	transform: translateY(-1px);
}

.woocommerce-MyAccount-content .wc-affiliate-referral-link-section button#wc-affiliate-copy-btn:active {
	transform: translateY(0);
}

.woocommerce-MyAccount-content .wc-affiliate-copy-feedback {
	color: #2ecc71;
	font-weight: 700;
	font-size: 13px;
	margin-left: 4px;
}

/* =============================================
   How It Works — Numbered Steps
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-how-it-works {
	margin-bottom: 32px;
	padding: 12px 25px;
	background: #fff;
	border: 1px solid #edf0f2;
	border-radius: 16px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.02);
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works h3 {
	margin: 0 0 18px 0;
	padding: 0;
	font-size: 18px;
	font-weight: 800;
	color: #1a1a2e;
	border: none;
	background: none;
	letter-spacing: -0.2px;
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: steps;
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul li {
	position: relative;
	padding: 12px 0 12px 44px;
	font-size: 14px;
	color: #4a4a5a;
	line-height: 1.6;
	counter-increment: steps;
	border-bottom: 1px solid #f5f6f8;
	list-style-type: none;
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul li::marker {
	content: none;
	display: none;
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul li::before {
	content: counter(steps);
	position: absolute;
	left: 0;
	top: 12px;
	width: 28px;
	height: 28px;
	background: linear-gradient(135deg, #145a32, #1e8449);
	color: #fff;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(20, 90, 50, 0.3);
}

.woocommerce-MyAccount-content .wc-affiliate-how-it-works ul li strong {
	color: #1a1a2e;
	font-weight: 700;
}

/* =============================================
   Stats Cards
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 28px;
}

.woocommerce-MyAccount-content .wc-affiliate-stat-card {
	position: relative;
	background: #fff;
	border: 1px solid #edf0f2;
	border-radius: 14px;
	padding: 24px 18px 20px;
	text-align: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.02);
	overflow: hidden;
}

.woocommerce-MyAccount-content .wc-affiliate-stat-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #145a32, #27ae60);
}

.woocommerce-MyAccount-content .wc-affiliate-stat-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
	border-color: #d5dde3;
}

.woocommerce-MyAccount-content .wc-affiliate-stat-number {
	display: block;
	font-size: 28px;
	font-weight: 900;
	color: #1a1a2e;
	margin-bottom: 6px;
	line-height: 1.1;
	letter-spacing: -0.5px;
}

.woocommerce-MyAccount-content .wc-affiliate-stat-number .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.woocommerce-MyAccount-content .wc-affiliate-stat-label {
	display: block;
	font-size: 11px;
	color: #8a8a9a;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 600;
}

/* =============================================
   Balance Info — Accent Bar
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-balance-info {
	position: relative;
	margin-bottom: 28px;
	padding: 20px 24px;
	background: linear-gradient(135deg, #f0faf3 0%, #e8f8ec 100%);
	border: 1px solid #c8e6c9;
	border-left: 5px solid #27ae60;
	border-radius: 0 14px 14px 0;
	box-shadow: 0 2px 8px rgba(39, 174, 96, 0.08);
}

.woocommerce-MyAccount-content .wc-affiliate-balance-info p {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: #1a1a2e;
}

.woocommerce-MyAccount-content .wc-affiliate-balance-info strong {
	color: #145a32;
	font-size: 20px;
	font-weight: 800;
}

/* =============================================
   Status Badges — Pill Design
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-status-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 14px;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.3;
	white-space: nowrap;
}

.woocommerce-MyAccount-content .wc-affiliate-status-pending {
	background: linear-gradient(135deg, #fff9e6, #fff3cd);
	color: #7d5a00;
	border: 1px solid #ffe082;
}

.woocommerce-MyAccount-content .wc-affiliate-status-approved {
	background: linear-gradient(135deg, #e8f4fd, #cce5ff);
	color: #004085;
	border: 1px solid #90caf9;
}

.woocommerce-MyAccount-content .wc-affiliate-status-paid {
	background: linear-gradient(135deg, #e8f8ec, #d4edda);
	color: #145a32;
	border: 1px solid #a5d6a7;
}

.woocommerce-MyAccount-content .wc-affiliate-status-rejected {
	background: linear-gradient(135deg, #fde8e8, #f8d7da);
	color: #721c24;
	border: 1px solid #ef9a9a;
}

/* =============================================
   Tier Info
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-tier-info {
	position: relative;
	margin-bottom: 25px;
	padding: 28px 28px 24px;
	background: #1a1a2e;
	border: none;
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(26, 26, 46, 0.15);
	overflow: hidden;
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #27ae60, #2ecc71, #27ae60);
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info h3 {
	margin: 0 0 8px 0;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	color: #fff !important;
	border: none;
	background: none;
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info > p,
.woocommerce-MyAccount-content .wc-affiliate-tier-info p {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.7) !important;
	margin: 0 0 6px 0;
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info > p strong,
.woocommerce-MyAccount-content .wc-affiliate-tier-info p strong {
	color: #2ecc71 !important;
	font-weight: 800;
}

.woocommerce-MyAccount-content .wc-affiliate-tiers-table {
	max-width: 340px;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: 16px;
}

.woocommerce-MyAccount-content .wc-affiliate-tiers-table th,
.woocommerce-MyAccount-content .wc-affiliate-tiers-table td {
	padding: 11px 20px;
	font-size: 14px;
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info .wc-affiliate-tiers-table thead th {
	background: rgba(255, 255, 255, 0.06);
	font-weight: 700;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.45);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	border-top: none;
}

.woocommerce-MyAccount-content .wc-affiliate-tier-info .wc-affiliate-tiers-table tbody td {
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.7);
	border-top: none;
}

.woocommerce-MyAccount-content .wc-affiliate-tiers-table tbody tr:last-child td {
	border-bottom: none;
}

.woocommerce-MyAccount-content .wc-affiliate-current-tier {
	background: rgba(39, 174, 96, 0.15) !important;
	font-weight: 700;
}

.woocommerce-MyAccount-content .wc-affiliate-current-tier td {
	color: #2ecc71;
}

/* =============================================
   Referrals History Table — Clean Design
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-dashboard > h3 {
	font-size: 18px;
	font-weight: 800;
	color: #1a1a2e;
	margin: 20px 0 16px 0;
	padding: 0;
	border: none;
	background: none;
	letter-spacing: -0.2px;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.02);
	border: 1px solid #edf0f2;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table thead th {
	background: #f5f7f9;
	padding: 14px 18px;
	font-size: 11px;
	font-weight: 700;
	color: #8a8a9a;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	text-align: left;
	border-bottom: 2px solid #edf0f2;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody td {
	padding: 16px 18px;
	font-size: 14px;
	color: #2d3436;
	border-bottom: 1px solid #f5f6f8;
	vertical-align: middle;
	transition: background 0.15s;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody tr:last-child td {
	border-bottom: none;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody tr:hover td {
	background: #fafbfc;
}

.woocommerce-MyAccount-content .wc-affiliate-referrals-table small {
	color: #8a8a9a;
	font-size: 12px;
	font-weight: 500;
}

/* =============================================
   Pagination
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-dashboard .woocommerce-pagination {
	margin-top: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.woocommerce-MyAccount-content .wc-affiliate-dashboard .woocommerce-pagination .button {
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 600;
	border: 1px solid #edf0f2;
	border-radius: 10px;
	background: #fff;
	color: #2d3436;
	text-decoration: none;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.woocommerce-MyAccount-content .wc-affiliate-dashboard .woocommerce-pagination .button:hover {
	background: #f5f7f9;
	border-color: #d5dde3;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
}

.woocommerce-MyAccount-content .wc-affiliate-dashboard .woocommerce-pagination span {
	font-size: 13px;
	color: #8a8a9a;
	font-weight: 500;
}

/* =============================================
   Empty State
   ============================================= */
.woocommerce-MyAccount-content .wc-affiliate-dashboard > p {
	font-size: 14px;
	color: #8a8a9a;
	padding: 40px 24px;
	text-align: center;
	background: #fafbfc;
	border: 2px dashed #e0e3e8;
	border-radius: 14px;
}

/* =============================================
   Responsive — Tablet
   ============================================= */
@media (max-width: 768px) {
	.woocommerce-MyAccount-content .wc-affiliate-stats {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referral-link-wrapper {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referral-input {
		min-width: auto;
		text-align: center;
	}

	.woocommerce-MyAccount-content #wc-affiliate-copy-btn {
		text-align: center;
		width: 100%;
	}

	.woocommerce-MyAccount-content .wc-affiliate-how-it-works {
		padding: 20px 24px;
	}

	/* Table -> Card layout on mobile */
	.woocommerce-MyAccount-content .wc-affiliate-referrals-table {
		border: none;
		box-shadow: none;
		border-radius: 0;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referrals-table thead {
		display: none;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody tr {
		display: block;
		margin-bottom: 12px;
		background: #fff;
		border: 1px solid #edf0f2;
		border-radius: 14px;
		overflow: hidden;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
	}

	.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 11px 18px;
		border-bottom: 1px solid #f5f6f8;
		font-size: 14px;
		text-align: right;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody td::before {
		content: attr(data-title) ":";
		font-weight: 700;
		font-size: 11px;
		color: #8a8a9a;
		text-transform: uppercase;
		letter-spacing: 0.5px;
		flex-shrink: 0;
		margin-right: auto;
		padding-right: 16px;
		text-align: left;
	}

	.woocommerce-MyAccount-content .wc-affiliate-referrals-table tbody td:last-child {
		border-bottom: none;
	}
}

/* =============================================
   Responsive — Mobile
   ============================================= */
@media (max-width: 480px) {
	.woocommerce-MyAccount-content .wc-affiliate-stats {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.woocommerce-MyAccount-content .wc-affiliate-stat-card {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		text-align: left;
	}

	.woocommerce-MyAccount-content .wc-affiliate-stat-card::before {
		display: none;
	}

	.woocommerce-MyAccount-content .wc-affiliate-stat-number {
		order: 2;
		font-size: 22px;
		margin-bottom: 0;
	}

	.woocommerce-MyAccount-content .wc-affiliate-stat-label {
		order: 1;
		font-size: 12px;
	}

	.woocommerce-MyAccount-content .wc-affiliate-how-it-works {
		padding: 16px 18px;
		border-radius: 12px;
	}

	.woocommerce-MyAccount-content .wc-affiliate-balance-info {
		padding: 16px 18px;
		border-radius: 0 12px 12px 0;
	}

	.woocommerce-MyAccount-content .wc-affiliate-balance-info strong {
		font-size: 17px;
	}
}
