/**
 * Affiliate Dashboard Styles
 * Used by [mlmmc_affiliate_dashboard] shortcode
 */

/* ===== WRAPPER ===== */
.affwp-dashboard {
	font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
	max-width: 100%;
	margin: 0 auto;
	color: #333;
}

/* ===== STAT CARDS ===== */
.affwp-dashboard__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1rem;
	margin-bottom: 1.75rem;
}

.affwp-stat-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.25rem 1rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
	transition: box-shadow 0.2s ease;
}

.affwp-stat-card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.affwp-stat-card__label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
}

.affwp-stat-card__value {
	font-size: 1.5rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
}

/* ===== URL / COUPON BOXES ===== */
.affwp-dashboard__urls {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.25rem;
	margin-bottom: 1.75rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.affwp-url-box__label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.4rem;
}

.affwp-url-box__row {
	display: flex;
	gap: 0.5rem;
}

.affwp-url-box__input {
	flex: 1;
	padding: 0.55rem 0.75rem;
	font-size: 0.875rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #111827;
	min-width: 0;
	font-family: monospace;
}

.affwp-url-box__input:focus {
	outline: 2px solid #6366f1;
	outline-offset: 1px;
}

/* Copy buttons — styled by theme's .button-primary */

.affwp-rate-info {
	font-size: 0.85rem;
	color: #6b7280;
}

.affwp-rate-info strong {
	color: #111827;
}

/* ===== TABS NAV ===== */
.affwp-dashboard__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 1.5rem;
}

.affwp-dashboard__tab {
	padding: 0.6rem 1.1rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #6b7280;
	background: none;
	border: 1px solid transparent;
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	margin-bottom: -2px;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s ease, background 0.15s ease;
}

.affwp-dashboard__tab:hover {
	color: #111827;
	background: #f3f4f6;
}

.affwp-dashboard__tab--active {
	color: #6366f1;
	background: #fff;
	border-color: #e5e7eb;
	border-bottom-color: #fff;
}

/* ===== TAB CONTENT ===== */
.affwp-dashboard__content {
	min-height: 200px;
}

.affwp-tab-panel--hidden {
	display: none;
}

/* Status badges */
.affwp-status {
	display: inline-block;
	padding: 0.2em 0.6em;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: capitalize;
}

.affwp-status--paid,
.affwp-status--active {
	background: #d1fae5;
	color: #065f46;
}

.affwp-status--unpaid,
.affwp-status--pending {
	background: #fef3c7;
	color: #92400e;
}

.affwp-status--rejected,
.affwp-status--failed {
	background: #fee2e2;
	color: #991b1b;
}

/* Truncate long URLs in visits table */
.affwp-url-cell {
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.affwp-tab-panel h3 {
	font-size: 1.1rem;
	font-weight: 600;
	color: #111827;
	margin: 0 0 1.25rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid #f0f0f0;
}

/* ===== TABLES ===== */
.affwp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.affwp-table th {
	text-align: left;
	padding: 0.65rem 0.85rem;
	background: #f9fafb;
	border-bottom: 2px solid #e5e7eb;
	font-weight: 600;
	color: #374151;
	white-space: nowrap;
}

.affwp-table td {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid #f0f0f0;
	color: #374151;
	vertical-align: middle;
}

.affwp-table tr:last-child td {
	border-bottom: none;
}

.affwp-table tr:hover td {
	background: #f9fafb;
}

/* Overview specific – label column */
.affwp-table--overview th {
	width: 180px;
	background: transparent;
	border-bottom: 1px solid #f0f0f0;
	font-weight: 600;
	color: #6b7280;
}

/* ===== EMPTY STATE ===== */
.affwp-empty {
	color: #9ca3af;
	font-style: italic;
	padding: 1rem 0;
}

/* ===== CHARTS ===== */
.affwp-charts-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	align-items: flex-start;
	margin-top: 1.5rem;
}

.affwp-chart-wrap {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1rem;
	text-align: center;
	flex: 0 0 auto;
}

.affwp-chart-wrap h4 {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #6b7280;
}

.affwp-chart--earnings {
	width: 170px !important;
	height: 170px !important;
}

.affwp-chart--referrals {
	width: 260px !important;
	height: 160px !important;
}

/* ===== CREATIVES GRID ===== */
.affwp-creatives-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}

.affwp-creative-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.affwp-creative-card__name {
	font-size: 0.9rem;
	font-weight: 600;
	color: #111827;
	margin: 0;
}

.affwp-creative-card__image {
	max-width: 100%;
	border-radius: 6px;
	display: block;
}

.affwp-creative-card__desc {
	font-size: 0.8rem;
	color: #6b7280;
	margin: 0;
}

/* ===== URL GENERATOR ===== */
.affwp-url-generator {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* ===== NOTICE MESSAGES ===== */
.affwp-login-notice,
.affwp-not-affiliate-notice {
	padding: 1rem 1.25rem;
	border-radius: 8px;
	background: #fef3c7;
	border: 1px solid #fde68a;
	color: #92400e;
	font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
	.affwp-dashboard__stats {
		grid-template-columns: repeat(2, 1fr);
	}

	.affwp-url-box__row {
		flex-direction: column;
	}

	.affwp-table th,
	.affwp-table td {
		padding: 0.5rem 0.6rem;
		font-size: 0.8rem;
	}

	.affwp-dashboard__tab {
		font-size: 0.8rem;
		padding: 0.5rem 0.75rem;
	}
}
