/* Essential styles for the affiliate history display */

.op3-element[data-op3-element-type=customhtml] [data-op3-code-html] {
	overflow: initial !important;
}

.j3-affiliate-history-wrapper {
	padding: 20px 0;
}

.j3-affiliate-stats {
	display: flex;
	margin-bottom: 30px;
}

.j3-stat-box {
	padding: 20px;
	border-radius: 4px;
	border: none;
	padding: 20px 15px;
	position: relative;
	background: none;
	flex: 0 0 23.5%;
	border-top: 6px solid #000000;
	box-shadow: 0 0 10px 0 rgb(0 0 0 / 10%);
}
.j3-stat-box:not(:last-child) {
	margin-right: 2%;
}

.j3-stat-amount {
	font-size: 28px;
	font-weight: bold;
}

.j3-payout-request {
	margin: 20px 0;
}

.j3-payout-request .button_request_payout {
	background-color: #111827;
	color: #ffffff;
	padding: 10px 20px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.j3-payout-request .button_request_payout:hover:not(:disabled) {
	background-color: #1f2937;
}

.j3-payout-request .button_request_payout:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.j3-filter-section {
	background: #f9fafb;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 20px;
}

.j3-filter-form {
	display: flex;
	gap: 15px;
	align-items: end;
	flex-wrap: wrap;
}

.j3-filter-group {
	flex: 1;
	min-width: 200px;
}

.j3-filter-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	font-size: 14px;
}

.j3-filter-group input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
}

.j3-filter-button {
	background-color: #111827;
	color: #ffffff;
	padding: 8px 20px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

.j3-history-table {
	width: 100%;
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.j3-history-table table {
	width: 100%;
	border-collapse: collapse;
}

.j3-history-table thead {
	background-color: #f9fafb;
}

.j3-history-table th {
	padding: 12px;
	text-align: left;
	font-weight: 600;
	font-size: 14px;
	color: #374151;
	border-bottom: 1px solid #e5e7eb;
}

.j3-history-table td {
	padding: 12px;
	font-size: 14px;
	color: #6b7280;
	border-bottom: 1px solid #f3f4f6;
}

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

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

.badge {
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
	display: inline-block;
}

.badge-success { background-color: #c7f5d9; color: #0b4121; }
.badge-primary { background-color: #cfe0fc; color: #0a47a9; }
.badge-warning { background-color: #ffebc2; color: #453008; }
.badge-refund { background-color: #ff0000c2; color: #fff; }

.alert {
	padding: 15px;
	border-radius: 6px;
	margin-bottom: 20px;
}

.alert-success {
	background-color: #c7f5d9;
	color: #0b4121;
	border: 1px solid #86efac;
}

.alert-danger {
	background-color: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.j3-stripe-section {
	margin-bottom: 30px;
	padding: 20px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.j3-stripe-section h3 {
	margin-top: 0;
}

.j3-stripe-form-grid {
	display: grid;
	gap: 15px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.j3-stripe-field label {
	display: block;
	font-weight: 500;
	font-size: 14px;
	margin-bottom: 6px;
}

.j3-stripe-field input,
.j3-stripe-field select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
}

.j3-stripe-actions {
	margin-top: 20px;
}

.j3-stripe-button {
	background-color: #111827;
	color: #ffffff;
	padding: 10px 22px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.j3-stripe-button.secondary {
	background-color: #2563eb;
	color: #ffffff;
}

.j3-stripe-button:hover:not(:disabled) {
	opacity: 0.9;
}

.j3-stripe-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.j3-stripe-status {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	font-weight: 500;
}

.j3-stripe-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #d1d5db;
	display: inline-block;
}

.j3-stripe-dot.is-active {
	background: #16a34a;
}

.j3-stripe-dot.is-pending {
	background: #f97316;
}

.j3-stripe-subcopy {
	font-size: 12px;
	color: #6b7280;
	margin-top: 8px;
}

.j3-stripe-table {
	margin-top: 20px;
}

.j3-stripe-table table {
	width: 100%;
	border-collapse: collapse;
}

.j3-stripe-table th,
.j3-stripe-table td {
	padding: 10px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	font-size: 14px;
}

.j3-stripe-table tbody tr:hover {
	background: #f9fafb;
}

.j3-stripe-empty {
	font-size: 14px;
	color: #6b7280;
	margin: 10px 0 0;
}

.j3-stripe-inline-link {
	color: inherit;
	text-decoration: underline;
}

.j3-stats-grid {
	display: flex;
	margin: 25px 0;
	flex-wrap: wrap;
}

.j3-stat-header {
	display: flex;
	align-items: start;
	gap: 18px;
	flex-direction: column;
	height: 100%;
	justify-content: space-between;
}

.j3-stat-icon-circle {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	font-size: 24px;
	display: flex;
	justify-content: center;
	align-items: center;
	background: #fff;
}

.j3-stat-label {
	font-size: 14.5px;
	font-weight: 700;
	color: #444444;
	display: flex;
	align-items: center;
	margin-bottom: 10px;
}

.j3-stat-sub-label {
	font-size: 16px;
	color: #555;
	margin-top: 2px;
	line-height: 1.4;
}

.j3-stat-amount {
	font-size: 24px;
	font-weight: 800;
}

.j3-stat-icon-circle svg {
	width: 32px;
	height: 32px;
	fill: white;
}

.paid .j3-stat-icon-circle svg {
	width: 50px;
	height: 50px;
}

.ready .j3-stat-icon-circle , .approved .j3-stat-icon-circle{
	background: #0f9d50;
}
.progress .j3-stat-icon-circle{
	background: #4892f5;
}
.paid .j3-stat-icon-circle{
	background: #fff6da;
}
.j3-info {
	line-height: 0;
	position: relative;
	display: inline-block;
	margin-left: 5px;
}

.info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #444444;
	color: #fff;
	font-size: 12px;
	font-weight: bold;
	cursor: pointer;
}

.tooltip {
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.2s ease;
	position: absolute;
	bottom: 120%;
	left: 50%;
	transform: translateX(-50%);
	width: 220px;
	background: #000;
	color: #fff;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.4;
	z-index: 20;
}

.j3-info:hover .tooltip {
	visibility: visible;
	opacity: 1;
}

@media (max-width: 768px) {
	.j3-affiliate-stats {
		grid-template-columns: 1fr;
	}

	.j3-filter-form {
		flex-direction: column;
	}

	.j3-filter-group {
		width: 100%;
	}

	.j3-history-table {
		overflow-x: auto;
	}
	.j3-stripe-table {
		overflow-x: auto;
	}
}

@media (max-width: 1024px) {
	.j3-stat-box {
		flex: 0 0 48%;
		margin-bottom: 20px;
	}
}

@media (max-width: 767px) {
	.j3-stat-box {
		flex: 0 0 100%;
		margin-right: 0;
	}

}