/**
 * Advanced Gift Card Report Styles
 * @package Ultimate Woocommerce Gift Cards
 */

/* ===========================
   Dashboard Container
   =========================== */
.wps-uwgc-advanced-dashboard {
	margin: 20px 0;
	background: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
}

/* ===========================
   Metrics Grid - 10 Cards
   =========================== */
.wps-uwgc-metrics-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.wps-uwgc-metric-card {
	background: #ffffff;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.08);
	transition: all 0.3s ease;
	border-left: 4px solid #ddd;
	display: flex;
	gap: 15px;
	align-items: flex-start;
}

.wps-uwgc-metric-card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

/* Metric Icon */
.wps-metric-icon {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.wps-metric-icon .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

/* Metric Content */
.wps-metric-content {
	flex: 1;
}

.wps-metric-content h3 {
	margin: 0 0 5px 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	color: #2c3e50;
}

.wps-metric-content p {
	margin: 0 0 8px 0;
	font-size: 13px;
	color: #7f8c8d;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.wps-metric-trend,
.wps-metric-percentage,
.wps-metric-count,
.wps-metric-average,
.wps-metric-value,
.wps-metric-range {
	font-size: 12px;
	color: #95a5a6;
	display: block;
}

/* Color Variants */
.wps-metric-primary {
	border-left-color: #3498db;
}

.wps-metric-primary .wps-metric-icon {
	background: #ebf5fb;
	color: #3498db;
}

.wps-metric-success {
	border-left-color: #27ae60;
}

.wps-metric-success .wps-metric-icon {
	background: #eafaf1;
	color: #27ae60;
}

.wps-metric-info {
	border-left-color: #16a085;
}

.wps-metric-info .wps-metric-icon {
	background: #e8f8f5;
	color: #16a085;
}

.wps-metric-warning {
	border-left-color: #f39c12;
}

.wps-metric-warning .wps-metric-icon {
	background: #fef5e7;
	color: #f39c12;
}

.wps-metric-danger {
	border-left-color: #e74c3c;
}

.wps-metric-danger .wps-metric-icon {
	background: #fadbd8;
	color: #e74c3c;
}

/* Redemption Rate Gauge */
.wps-metric-gauge {
	width: 100%;
	height: 6px;
	background: #ecf0f1;
	border-radius: 3px;
	overflow: hidden;
	margin-top: 8px;
}

.wps-gauge-fill {
	height: 100%;
	background: linear-gradient(90deg, #27ae60, #2ecc71);
	transition: width 0.8s ease;
}

/* Trend Indicators */
.wps-trend-positive {
	color: #27ae60;
}

.wps-trend-negative {
	color: #e74c3c;
}

.wps-trend-neutral {
	color: #95a5a6;
}

/* ===========================
   Enhanced Table Styles
   =========================== */
.wps-gc-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.wps-status-active {
	background: #d5f4e6;
	color: #27ae60;
}

.wps-status-expired {
	background: #fadbd8;
	color: #e74c3c;
}

.wps-status-partial {
	background: #fff3cd;
	color: #f39c12;
}

.wps-status-redeemed {
	background: #d6eaf8;
	color: #2980b9;
}

/* Gift Card Code with Copy Button */
.wps-gc-code-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wps-gc-code-link {
	font-weight: 600;
	text-decoration: none;
}

.wps-copy-code {
	padding: 2px 6px;
	color: #7f8c8d;
	transition: color 0.2s;
}

.wps-copy-code:hover {
	color: #2c3e50;
}

.wps-copy-code .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Redeemed Indicator */
.wps-redeemed-indicator {
	color: #27ae60;
	font-weight: 500;
}

/* Redemption Count */
.wps-redemption-count {
	font-weight: 600;
	font-size: 16px;
}

/* Expiry Indicators */
.wps-expiring-warning {
	color: #e74c3c;
	font-weight: 500;
	font-size: 11px;
}

.wps-expiring-warning .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: middle;
}

.wps-no-expiry {
	color: #95a5a6;
	font-style: italic;
}

.wps-expired {
	color: #e74c3c;
	font-weight: 600;
}

.wps-expiring-soon {
	color: #f39c12;
	font-weight: 600;
}

.wps-active-expiry {
	color: #27ae60;
}

/* Source Badge */
.wps-source-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 10px;
	background: #ecf0f1;
	border-radius: 4px;
	font-size: 12px;
	color: #34495e;
}

.wps-source-badge .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Actions Column */
.wps-gc-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wps-quick-actions {
	display: flex;
	gap: 6px;
}

.wps-resend-email {
	color: #3498db;
	padding: 2px 6px;
}

.wps-resend-email:hover {
	color: #2980b9;
}

/* ===========================
   Advanced Filtering
   =========================== */
.wps-uwgc-filters-wrapper {
	background: #ffffff;
	padding: 20px;
	border-radius: 8px;
	margin: 20px 0;
	box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.wps-filters-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin-bottom: 15px;
}

.wps-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wps-filter-group label {
	font-size: 13px;
	font-weight: 600;
	color: #2c3e50;
}

.wps-filter-group select,
.wps-filter-group input[type="text"],
.wps-filter-group input[type="number"],
.wps-filter-group input[type="date"] {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.wps-filter-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 15px;
}

.wps-filter-actions .button {
	min-width: 100px;
}

/* ===========================
   Export Buttons
   =========================== */
.wps-export-wrapper {
	display: flex;
	gap: 10px;
	margin: 15px 0;
	flex-wrap: wrap;
}

.wps-export-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #ffffff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
}

.wps-export-btn:hover {
	background: #f8f9fa;
	border-color: #3498db;
	color: #3498db;
}

.wps-export-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* ===========================
   Loading States
   =========================== */
.wps-loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255,255,255,0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.wps-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #ecf0f1;
	border-top-color: #3498db;
	border-radius: 50%;
	animation: wps-spin 1s linear infinite;
}

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

/* ===========================
   Responsive Adjustments
   =========================== */
@media screen and (max-width: 1200px) {
	.wps-uwgc-metrics-grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}
}

@media screen and (max-width: 768px) {
	.wps-uwgc-metrics-grid {
		grid-template-columns: 1fr;
	}

	.wps-filters-grid {
		grid-template-columns: 1fr;
	}

	.wps-metric-content h3 {
		font-size: 24px;
	}
}

/* ===========================
   Tooltips
   =========================== */
.wps-tooltip {
	position: relative;
	display: inline-block;
}

.wps-tooltip:hover::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: #2c3e50;
	color: #ffffff;
	padding: 6px 12px;
	border-radius: 4px;
	white-space: nowrap;
	font-size: 12px;
	margin-bottom: 8px;
	z-index: 1000;
}

.wps-tooltip:hover::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #2c3e50;
	margin-bottom: 2px;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
	.wps-filter-actions,
	.wps-export-wrapper,
	.wps-gc-actions {
		display: none !important;
	}

	.wps-uwgc-metric-card {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ddd;
	}
}
