/* Community Tree Styles */

.tree-container {
	padding: 2em;
	min-height: 400px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.tree-loading, .tree-error {
	text-align: center;
	padding: 3em;
}

.loader {
	border: 3px solid rgba(var(--bg-color), 0.3);
	border-top: 3px solid var(--main-color);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
	margin: 2em auto;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.tree-error p {
	color: #f44336;
	font-size: 1.2em;
	margin-bottom: 1em;
}

.retry-btn {
	background: var(--main-color);
	color: #000;
	padding: 0.8em 2em;
	border: 2px solid var(--main-color);
	cursor: pointer;
	font-family: monospace;
	font-weight: bold;
	transition: all 0.3s ease;
}

.retry-btn:hover {
	background: transparent;
	color: var(--main-color);
	box-shadow: 0 0 20px var(--main-color);
}

.tree-content {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

/* Tree Structure */
.tree-node {
	margin: 1.5em 0;
	padding: 1em;
	border-left: 3px solid var(--main-color);
	position: relative;
	animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.tree-node::before {
	content: '';
	position: absolute;
	left: -3px;
	top: 0;
	width: 20px;
	height: 2px;
	background: var(--main-color);
}

/* Owner Node */
.tree-owner {
	border-left-color: #ffd700;
	background: rgba(255, 215, 0, 0.05);
	border: 2px solid #ffd700;
	border-left-width: 5px;
	margin-bottom: 3em;
}

.tree-owner::before {
	background: #ffd700;
}

.tree-owner .role-title {
	color: #ffd700;
}

/* Admin Nodes */
.tree-admins {
	margin-left: 2em;
	margin-bottom: 2em;
}

.tree-admin {
	border-left-color: #ff5722;
	background: rgba(255, 87, 34, 0.05);
}

.tree-admin::before {
	background: #ff5722;
}

.tree-admin .role-title {
	color: #ff5722;
}

/* Member Nodes */
.tree-members {
	margin-left: 4em;
}

.tree-member {
	border-left-color: var(--main-color);
	background: rgba(var(--bg-color), 0.05);
	margin: 0.8em 0;
	padding: 0.8em;
}

.tree-member::before {
	background: var(--main-color);
}

/* Role Title */
.role-title {
	font-size: 1.5em;
	font-weight: bold;
	margin-bottom: 0.5em;
	text-transform: uppercase;
	letter-spacing: 2px;
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.role-icon {
	font-size: 1.2em;
}

/* User Card */
.user-card {
	display: flex;
	align-items: center;
	gap: 1em;
	padding: 0.8em;
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid var(--main-color-40);
	margin: 0.5em 0;
	transition: all 0.3s ease;
}

.user-card:hover {
	background: rgba(var(--bg-color), 0.15);
	border-color: var(--main-color);
	box-shadow: 0 0 15px var(--main-color-40);
	transform: translateX(5px);
}

.user-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid var(--main-color);
	object-fit: cover;
}

.user-info {
	flex: 1;
}

.user-name {
	font-weight: bold;
	font-size: 1.1em;
	color: var(--main-color);
}

.user-username {
	font-size: 0.9em;
	opacity: 0.7;
	font-family: monospace;
}

.user-status {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.status-indicator {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #4caf50;
}

.status-indicator.offline {
	background: #757575;
}

.status-indicator.idle {
	background: #ffc107;
}

.status-indicator.dnd {
	background: #f44336;
}

/* Member Count */
.member-count {
	font-size: 0.9em;
	opacity: 0.8;
	margin-left: 0.5em;
	font-weight: normal;
}

/* Connection Lines */
.tree-admins::before,
.tree-members::before {
	content: '';
	position: absolute;
	left: -1em;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--main-color-40);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
	.tree-container {
		padding: 1em;
	}

	.tree-admins {
		margin-left: 1em;
	}

	.tree-members {
		margin-left: 2em;
	}

	.user-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5em;
	}

	.user-avatar {
		width: 30px;
		height: 30px;
	}

	.role-title {
		font-size: 1.2em;
	}

	.user-name {
		font-size: 1em;
	}
}

/* Stats Section */
.tree-stats {
	display: flex;
	gap: 2em;
	justify-content: center;
	flex-wrap: wrap;
	margin: 2em 0;
	padding: 1.5em;
	background: rgba(var(--bg-color), 0.1);
	border: 1px solid var(--main-color-40);
}

.stat-item {
	text-align: center;
	padding: 1em;
}

.stat-number {
	font-size: 2em;
	font-weight: bold;
	color: var(--main-color);
}

.stat-label {
	font-size: 0.9em;
	opacity: 0.8;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* Last Updated */
.tree-updated {
	text-align: center;
	font-size: 0.85em;
	opacity: 0.6;
	margin-top: 2em;
	font-style: italic;
}
