/**
 * Admin Analytics Styles.
 *
 * @package RaffleForWooCommerce
 * @since   1.0.0
 */

.rfwc-analytics-page {
	max-width: 1400px;
}

/* Filters */
.rfwc-analytics-filters {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 20px;
	padding: 15px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
}

.rfwc-analytics-filters select {
	min-width: 150px;
}

/* Overview Stats */
.rfwc-analytics-overview {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	margin-bottom: 20px;
}

.rfwc-stat-card {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 20px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
}

.rfwc-stat-icon {
	font-size: 32px;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f1;
	border-radius: 50%;
	color: #7f54b3;
}

.rfwc-stat-content {
	display: flex;
	flex-direction: column;
}

.rfwc-stat-value {
	font-size: 24px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.2;
}

.rfwc-stat-label {
	font-size: 12px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Charts */
.rfwc-analytics-charts {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

.rfwc-chart-container {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
}

.rfwc-chart-container h3 {
	margin: 0 0 15px;
	font-size: 14px;
	font-weight: 600;
}

.rfwc-chart-container canvas {
	max-height: 300px;
}

.rfwc-chart-small canvas {
	max-height: 250px;
}

/* Tables */
.rfwc-analytics-tables {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.rfwc-table-container {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
}

.rfwc-table-container h3 {
	margin: 0 0 15px;
	font-size: 14px;
	font-weight: 600;
}

.rfwc-table-container .wp-list-table {
	margin: 0;
}

/* Status badges */
.rfwc-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
}

.status-active {
	background: #c6e1c6;
	color: #5b841b;
}

.status-ended {
	background: #f0f0f1;
	color: #646970;
}

.status-completed {
	background: #e7f3ff;
	color: #0073aa;
}

.status-scheduled {
	background: #fef8ee;
	color: #996800;
}

.status-failed {
	background: #fcf0f1;
	color: #d63638;
}

.status-cancelled {
	background: #fef0e5;
	color: #b05e14;
}

/* Loading state */
.rfwc-loading {
	text-align: center;
	padding: 40px;
	color: #646970;
}

.rfwc-loading::before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #ccd0d4;
	border-top-color: #7f54b3;
	border-radius: 50%;
	animation: rfwc-spin 0.8s linear infinite;
	margin-right: 10px;
	vertical-align: middle;
}

@keyframes rfwc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Activity Log */
.rfwc-activity-log-table .column-details {
	color: #50575e;
}

.rfwc-activity-log-table tr.rfwc-log-error {
	background-color: #fcf0f1;
}

.rfwc-activity-log-empty {
	color: #646970;
	font-style: italic;
	margin: 10px 0;
}

/* Responsive */
@media screen and (max-width: 1200px) {
	.rfwc-analytics-overview {
		grid-template-columns: repeat(2, 1fr);
	}

	.rfwc-analytics-charts {
		grid-template-columns: 1fr;
	}

	.rfwc-analytics-tables {
		grid-template-columns: 1fr;
	}
}

@media screen and (max-width: 782px) {
	.rfwc-analytics-filters {
		flex-wrap: wrap;
	}

	.rfwc-analytics-overview {
		grid-template-columns: 1fr;
	}

	.rfwc-stat-card {
		padding: 15px;
	}

	.rfwc-stat-icon {
		font-size: 24px;
		width: 40px;
		height: 40px;
	}

	.rfwc-stat-value {
		font-size: 20px;
	}
}
