/**
 * Forumax Dashboard Styles
 *
 * Modern, visually stunning dashboard design with premium aesthetics.
 *
 * @package Forumax
 * @since   2.1.0
 */

// Variables
$dashboard-primary: #6831c1;
$dashboard-primary-dark: #541fa3;
$dashboard-primary-light: #8652e0;
$dashboard-secondary: #f1bd6c;
$dashboard-success: #10b981;
$dashboard-warning: #f59e0b;
$dashboard-danger: #ef4444;
$dashboard-info: #3b82f6;
$dashboard-dark: #1e1e2f;
$dashboard-darker: #151521;
$dashboard-card-bg: #ffffff;
$dashboard-border: #e5e7eb;
$dashboard-text: #374151;
$dashboard-text-muted: #6b7280;
$dashboard-gradient: linear-gradient(135deg, $dashboard-primary 0%, $dashboard-primary-light 100%);

// Dashboard Wrapper
.forumax-dashboard-wrap {
	max-width: 1600px;
	margin: 20px 20px 20px 0;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	
	* {
		box-sizing: border-box;
	}
	margin: 20px auto;
}

.forumax-dashboard {
	background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

// Dashboard Header
.forumax-dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 32px;
	background: $dashboard-gradient;
	color: #fff;
	gap: 20px;
	flex-wrap: wrap;
	
	.forumax-dashboard-header-left {
		display: flex;
		align-items: center;
		gap: 20px;
	}
	
	.forumax-logo {
		img {
			height: 48px;
			width: auto;
		}
	}
	
	.forumax-header-text {
		h1 {
			margin: 0;
			font-size: 28px;
			font-weight: 700;
			line-height: 1.2;
			color: #fff;
		}
		
		p {
			margin: 4px 0 0;
			font-size: 14px;
			opacity: 0.9;
		}
	}
	
	.forumax-dashboard-header-right {
		display: flex;
		align-items: center;
		gap: 16px;
	}
	
	.forumax-version {
		background: rgba(255, 255, 255, 0.2);
		padding: 6px 12px;
		border-radius: 20px;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.5px;
	}
}

// Buttons
.forumax-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
	border: none;
	
	.dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}
	
	&.forumax-btn-secondary {
		background: rgba(255, 255, 255, 0.2);
		color: #fff;
		border: 1px solid rgba(255, 255, 255, 0.3);
		
		&:hover {
			background: rgba(255, 255, 255, 0.3);
			color: #fff;
		}
	}
	
	&.forumax-btn-upgrade {
		background: $dashboard-secondary;
		color: $dashboard-dark;
		width: 100%;
		justify-content: center;
		
		&:hover {
			background: darken($dashboard-secondary, 10%);
			transform: translateY(-2px);
			box-shadow: 0 4px 12px rgba($dashboard-secondary, 0.4);
		}
	}
}

// Statistics Section
.forumax-stats-section {
	padding: 32px;
	background: #fff;
	border-bottom: 1px solid $dashboard-border;
}

.forumax-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	@media screen and ( max-width: 1400px ) {
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	}
}

.forumax-stat-card {
	position: relative;
	background: $dashboard-card-bg;
	border-radius: 12px;
	padding: 24px;
	border: 1px solid $dashboard-border;
	transition: all 0.3s ease;
	overflow: hidden;
	
	&::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 4px;
		border-radius: 12px 12px 0 0;
	}
	
	&:hover {
		transform: translateY(-4px);
		box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
	}
	
	.forumax-stat-icon {
		width: 48px;
		height: 48px;
		border-radius: 12px;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 16px;
		
		.dashicons {
			font-size: 24px;
			width: 24px;
			height: 24px;
			color: #fff;
		}
	}
	
	.forumax-stat-content {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}
	
	.forumax-stat-number {
		font-size: 32px;
		font-weight: 700;
		line-height: 1;
		color: $dashboard-dark;
	}
	
	.forumax-stat-label {
		font-size: 14px;
		color: $dashboard-text-muted;
		font-weight: 500;
	}
	
	.forumax-stat-link {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		margin-top: 12px;
		font-size: 13px;
		font-weight: 600;
		color: $dashboard-primary;
		text-decoration: none;
		
		.dashicons {
			font-size: 16px;
			width: 16px;
			height: 16px;
			transition: transform 0.2s ease;
		}
		
		&:hover {
			color: $dashboard-primary-dark;
			
			.dashicons {
				transform: translateX(4px);
			}
		}
	}
	
	.forumax-stat-badge {
		display: inline-block;
		padding: 4px 8px;
		border-radius: 4px;
		font-size: 11px;
		font-weight: 600;
		margin-top: 8px;
		
		&.forumax-badge-warning {
			background: rgba($dashboard-warning, 0.1);
			color: darken($dashboard-warning, 15%);
		}
		
		&.forumax-badge-alert {
			background: rgba($dashboard-danger, 0.1);
			color: $dashboard-danger;
			animation: pulse-alert 2s infinite;
		}
	}
	
	// Card Variations
	&.forumax-stat-forums {
		&::before { background: $dashboard-primary; }
		.forumax-stat-icon { background: $dashboard-primary; }
	}

	&.forumax-stat-unanswered{
		&::before { background: $dashboard-warning; }
		.forumax-stat-icon { background: $dashboard-warning;}
	}
	
	&.forumax-stat-topics {
		&::before { background: $dashboard-info; }
		.forumax-stat-icon { background: $dashboard-info; }
	}
	
	&.forumax-stat-replies {
		&::before { background: $dashboard-success; }
		.forumax-stat-icon { background: $dashboard-success; }
	}
	
	&.forumax-stat-users {
		&::before { background: #8b5cf6; }
		.forumax-stat-icon { background: #8b5cf6; }
	}
	
	&.forumax-stat-tags {
		&::before { background: $dashboard-warning; }
		.forumax-stat-icon { background: $dashboard-warning; }
	}
	
	&.forumax-stat-pending {
		&::before { background: $dashboard-text-muted; }
		.forumax-stat-icon { background: $dashboard-text-muted; }
		
		&.has-pending {
			&::before { background: $dashboard-danger; }
			.forumax-stat-icon { background: $dashboard-danger; }
			border-color: rgba($dashboard-danger, 0.3);
		}
	}
}

@keyframes pulse-alert {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.6; }
}

// Dashboard Content
.forumax-dashboard-content {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 32px;
	padding: 32px;
	
	@media (max-width: 1200px) {
		grid-template-columns: 1fr;
	}
}

.forumax-dashboard-main {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.forumax-dashboard-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

// Cards
.forumax-card {
	background: $dashboard-card-bg;
	border-radius: 12px;
	border: 1px solid $dashboard-border;
	overflow: hidden;
	transition: box-shadow 0.3s ease;
	
	&:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	}
	
	.forumax-card-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 16px 20px;
		background: #f9fafb;
		border-bottom: 1px solid $dashboard-border;
		
		h2 {
			margin: 0;
			font-size: 16px;
			font-weight: 600;
			color: $dashboard-dark;
			display: flex;
			align-items: center;
			gap: 8px;
			
			.dashicons {
				font-size: 20px;
				width: 20px;
				height: 20px;
				color: $dashboard-primary;
			}
		}
		
		&.forumax-gradient-header {
			background: $dashboard-gradient;
			
			h2 {
				color: #fff;
				
				.dashicons {
					color: $dashboard-secondary;
				}
			}
		}
	}
	
	.forumax-card-body {
		padding: 20px;
	}
	
	.forumax-view-all {
		font-size: 13px;
		color: $dashboard-primary;
		text-decoration: none;
		font-weight: 500;
		
		&:hover {
			color: $dashboard-primary-dark;
		}
	}
}

// Quick Actions
.forumax-actions-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	
	@media (max-width: 768px) {
		grid-template-columns: repeat(2, 1fr);
	}
}

.forumax-action-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 20px;
	background: #f9fafb;
	border-radius: 12px;
	text-decoration: none;
	transition: all 0.3s ease;
	border: 1px solid transparent;
	
	.forumax-action-icon {
		width: 52px;
		height: 52px;
		border-radius: 12px;
		background: $dashboard-gradient;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: transform 0.3s ease;
		
		.dashicons {
			font-size: 24px;
			width: 24px;
			height: 24px;
			color: #fff;
		}
	}
	
	.forumax-action-label {
		font-size: 13px;
		font-weight: 600;
		color: $dashboard-text;
		text-align: center;
	}
	
	&:hover {
		background: #fff;
		border-color: $dashboard-primary;
		box-shadow: 0 4px 12px rgba($dashboard-primary, 0.15);
		
		.forumax-action-icon {
			transform: scale(1.1);
		}
	}
}

// Activity List
.forumax-activity-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.forumax-activity-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid $dashboard-border;
	
	&:last-child {
		border-bottom: none;
		padding-bottom: 0;
	}
	
	&:first-child {
		padding-top: 0;
	}
	
	.forumax-activity-avatar {
		flex-shrink: 0;
		
		img {
			width: 40px;
			height: 40px;
			border-radius: 50%;
			object-fit: cover;
		}
	}
	
	.forumax-activity-content {
		flex: 1;
		min-width: 0;
	}
	
	.forumax-activity-title {
		display: block;
		font-size: 14px;
		font-weight: 600;
		color: $dashboard-dark;
		text-decoration: none;
		margin-bottom: 4px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		
		&:hover {
			color: $dashboard-primary;
		}
		&:focus {
			outline: none;
		}
	}
	
	.forumax-activity-excerpt {
		font-size: 13px;
		color: $dashboard-text;
		line-height: 1.5;
		margin-bottom: 6px;
	}
	
	.forumax-activity-meta {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 6px;
		font-size: 12px;
		color: $dashboard-text-muted;
		
		a {
			color: $dashboard-primary;
			text-decoration: none;
			
			&:hover {
				text-decoration: underline;
			}
		}
	}
	
	.forumax-activity-separator {
		opacity: 0.5;
	}
	
	.forumax-activity-stats {
		flex-shrink: 0;
	}
	
	.forumax-reply-count {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		padding: 4px 8px;
		background: #f3f4f6;
		border-radius: 4px;
		font-size: 12px;
		color: $dashboard-text-muted;
		
		.dashicons {
			font-size: 14px;
			width: 14px;
			height: 14px;
		}
	}
}

// Empty State
.forumax-empty-state {
	text-align: center;
	padding: 32px 20px;
	color: $dashboard-text-muted;
	
	.dashicons {
		font-size: 48px;
		width: 48px;
		height: 48px;
		margin-bottom: 12px;
		opacity: 0.3;
	}
	
	p {
		margin: 0;
		font-size: 14px;
	}
}

// Engagement Stats
.forumax-engagement-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid $dashboard-border;
	
	&:last-child {
		border-bottom: none;
		padding-bottom: 0;
	}
	
	&:first-child {
		padding-top: 0;
	}
	
	.forumax-engagement-label {
		font-size: 13px;
		color: $dashboard-text-muted;
	}
	
	.forumax-engagement-value {
		font-size: 18px;
		font-weight: 700;
		color: $dashboard-dark;
	}
}

// Pro Features
.forumax-pro-features {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	
	li {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 8px 0;
		font-size: 13px;
		color: $dashboard-text;
		
		.dashicons {
			font-size: 16px;
			width: 16px;
			height: 16px;
			color: $dashboard-success;
		}
	}
}

// System Info
.forumax-info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid $dashboard-border;
	
	&:last-child {
		border-bottom: none;
		padding-bottom: 0;
	}
	
	&:first-child {
		padding-top: 0;
	}
	
	.forumax-info-label {
		font-size: 13px;
		color: $dashboard-text-muted;
	}
	
	.forumax-info-value {
		font-size: 13px;
		font-weight: 600;
		color: $dashboard-dark;
		
		&.forumax-plan-badge {
			padding: 4px 10px;
			border-radius: 12px;
			font-size: 11px;
			text-transform: uppercase;
			letter-spacing: 0.5px;
			
			&.free {
				background: #f3f4f6;
				color: $dashboard-text-muted;
			}
			
			&.pro {
				background: linear-gradient(135deg, $dashboard-secondary, darken($dashboard-secondary, 10%));
				color: $dashboard-dark;
			}
		}
	}
}

// Helpful Links
.forumax-links-list {
	list-style: none;
	margin: 0;
	padding: 0;
	
	li {
		margin-bottom: 8px;
		
		&:last-child {
			margin-bottom: 0;
		}
		
		a {
			display: flex;
			align-items: center;
			gap: 10px;
			padding: 10px 12px;
			background: #f9fafb;
			border-radius: 8px;
			text-decoration: none;
			color: $dashboard-text;
			font-size: 13px;
			font-weight: 500;
			transition: all 0.2s ease;
			
			.dashicons {
				font-size: 18px;
				width: 18px;
				height: 18px;
				color: $dashboard-primary;
			}
			
			&:hover {
				background: $dashboard-primary;
				color: #fff;
				
				.dashicons {
					color: #fff;
				}
			}
		}
	}
}

// Error State
.forumax-dashboard-error {
	background: #fff;
	border: 1px solid $dashboard-border;
	border-radius: 12px;
	padding: 40px;
	text-align: center;
	margin-top: 20px;
	
	h2 {
		margin: 0 0 12px;
		color: $dashboard-danger;
	}
	
	p {
		margin: 0;
		color: $dashboard-text-muted;
	}
}
