/**
 * Frontend styles - Improved Design
 */

.cd-affiliate-dashboard {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 0;
}

.cd-affiliate-dashboard h2 {
	margin: 0 0 30px 0;
	font-size: 28px;
	font-weight: 700;
}

/* Link Section */
.cd-affiliate-link-section {
	background: #fff;
	padding: 25px;
	border-radius: 8px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	border: 1px solid #e5e7eb;
}

.cd-affiliate-link-section h3 {
	margin: 0 0 15px 0;
	font-size: 18px;
	font-weight: 600;
}

.cd-copy-link-box {
	display: flex;
	gap: 10px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.cd-copy-link-box input {
	flex: 1;
	min-width: 250px;
	padding: 12px 15px;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: monospace;
	transition: border-color 0.2s;
}

.cd-copy-link-box input:focus {
	outline: none;
	border-color: #3b82f6;
}

.cd-copy-link-box button {
	padding: 12px 24px;
	white-space: nowrap;
	background: #3b82f6;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.cd-copy-link-box button:hover {
	background: #2563eb;
}

/* Link button (blue) */
.cd-btn-link {
	padding: 12px 24px;
	background: #3b82f6;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cd-btn-link:hover {
	background: #2563eb;
}

/* Payout button (black) */
.cd-btn-payout {
	padding: 12px 24px;
	background: #111827;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cd-btn-payout:hover {
	background: #000000;
}

.cd-copy-feedback {
	color: #10b981;
	font-weight: 600;
	margin: 10px 0 0 0;
	padding: 8px 12px;
	background: #d1fae5;
	border-radius: 4px;
	display: inline-block;
}

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

.cd-stat-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	transition: transform 0.2s, box-shadow 0.2s;
}

.cd-stat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cd-stat-card h4 {
	margin: 0 0 12px 0;
	font-size: 13px;
	color: #6b7280;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cd-stat-value {
	font-size: 32px;
	font-weight: 700;
	color: #111827;
	line-height: 1;
}

/* History Table */
.cd-history-section {
	margin-top: 40px;
	background: #fff;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	border: 1px solid #e5e7eb;
}

.cd-history-section h3 {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-weight: 600;
}

/* Table wrapper for mobile scroll */
.cd-history-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cd-history-table {
	min-width: 560px;
}

.cd-history-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.cd-history-table th,
.cd-history-table td {
	padding: 14px 12px;
	text-align: left;
	border-bottom: 1px solid #f3f4f6;
}

.cd-history-table th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cd-history-table tbody tr {
	transition: background 0.15s;
}

.cd-history-table tbody tr:hover {
	background: #f9fafb;
}

.cd-history-table tbody tr:last-child td {
	border-bottom: none;
}

.cd-status {
	display: inline-block;
	padding: 5px 14px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cd-status-pending {
	background: #fef3c7;
	color: #92400e;
}

.cd-status-earned {
	background: #d1fae5;
	color: #065f46;
}

.cd-status-paid {
	background: #dbeafe;
	color: #1e40af;
}

.cd-status-void {
	background: #fee2e2;
	color: #991b1b;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
	.cd-affiliate-dashboard {
		padding: 15px;
	}

	.cd-stats-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}

	.cd-copy-link-box {
		flex-direction: column;
	}

	.cd-copy-link-box input {
		min-width: 100%;
	}

	.cd-history-table {
		font-size: 13px;
	}

	.cd-history-table th,
	.cd-history-table td {
		padding: 10px 8px;
	}

	.cd-stat-value {
		font-size: 26px;
	}
}

@media (max-width: 600px) {
	.cd-history-section {
		padding: 15px;
	}

	.cd-history-section h3 {
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	.cd-stats-grid {
		grid-template-columns: 1fr;
	}

	.cd-stat-value {
		font-size: 24px;
	}

	.cd-affiliate-dashboard h2 {
		font-size: 24px;
	}
}
