/*
 * Munin Backend UI System
 * Premium, Dark-Mode Glassmorphism Aesthetic
 */

:root {
	/* Deep, rich backgrounds */
	--bg-base: #0f1115;
	--bg-surface: #1a1d24;
	
	/* Glass panels */
	--glass-bg: rgba(26, 29, 36, 0.65);
	--glass-border: rgba(255, 255, 255, 0.08);
	--glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

	/* Accents */
	--accent-primary: #3b82f6;
	--accent-primary-hover: #2563eb;
	--accent-success: #10b981;
	--accent-danger: #ef4444;

	/* Text */
	--text-main: #f3f4f6;
	--text-muted: #9ca3af;
	
	/* Font */
	--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
	
	/* Transitions */
	--transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--font-sans);
	background-color: var(--bg-base);
	color: var(--text-main);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	
	/* Subtle gradient background */
	background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
					  radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
	background-attachment: fixed;
	min-height: 100vh;
}

/* Glassmorphism Panel Base */
.glass-panel {
	background: var(--glass-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid var(--glass-border);
	box-shadow: var(--glass-shadow);
	border-radius: 12px;
}

/* Typography */
h1, h2, h3, h4 {
	font-weight: 600;
	letter-spacing: -0.02em;
	color: #ffffff;
}

.logo-text {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.05em;
}

.logo-text .accent {
	color: var(--accent-primary);
}

.subtitle {
	color: var(--text-muted);
	font-size: 0.95rem;
	margin-top: 0.25rem;
}

.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.text-muted { color: var(--text-muted); }

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	font-size: 0.95rem;
	font-weight: 500;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: var(--transition-smooth);
	font-family: var(--font-sans);
}

.btn-primary {
	background-color: var(--accent-primary);
	color: white;
	box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
	background-color: var(--accent-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-outline-danger {
	background-color: transparent;
	color: var(--accent-danger);
	border-color: rgba(239, 68, 68, 0.3);
}

.btn-outline-danger:hover {
	background-color: rgba(239, 68, 68, 0.1);
	border-color: var(--accent-danger);
	transform: translateY(-1px);
}

.w-100 { width: 100%; }

/* Forms */
.form-group {
	margin-bottom: 1.25rem;
}

.form-group label {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
	width: 100%;
	padding: 0.75rem 1rem;
	background-color: rgba(0, 0, 0, 0.2);
	border: 1px solid var(--glass-border);
	border-radius: 8px;
	color: var(--text-main);
	font-family: var(--font-sans);
	font-size: 0.95rem;
	transition: var(--transition-smooth);
}

input:focus {
	outline: none;
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	background-color: rgba(0, 0, 0, 0.3);
}

/* Alerts */
.alert {
	padding: 1rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	border: 1px solid transparent;
}

.alert.error {
	background-color: rgba(239, 68, 68, 0.1);
	border-color: rgba(239, 68, 68, 0.2);
	color: #fca5a5;
}

.alert.success {
	background-color: rgba(16, 185, 129, 0.1);
	border-color: rgba(16, 185, 129, 0.2);
	color: #6ee7b7;
}

/* Install & Login Layout */
.install-body, .login-body {
	display: flex;
	align-items: center;
	justify-content: center;
}

.install-container, .login-container {
	width: 100%;
	max-width: 440px;
	padding: 2rem;
	animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	opacity: 0;
	transform: translateY(20px);
}

@keyframes fadeUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.install-card, .login-card {
	padding: 2.5rem;
}

.section-title {
	font-size: 1.1rem;
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--glass-border);
	color: #e5e7eb;
}

/* Dashboard Layout */
.dashboard-body {
	display: flex;
	height: 100vh;
	overflow: hidden;
}

.sidebar {
	width: 280px;
	height: calc(100vh - 2rem);
	margin: 1rem 0 1rem 1rem;
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	z-index: 10;
}

.sidebar-header {
	padding: 2rem 1.5rem;
}

.sidebar-nav {
	flex: 1;
	padding: 0 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.nav-item {
	display: block;
	padding: 0.75rem 1rem;
	color: var(--text-muted);
	text-decoration: none;
	border-radius: 8px;
	transition: var(--transition-smooth);
	font-weight: 500;
}

.nav-item:hover {
	color: var(--text-main);
	background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
	color: white;
	background-color: rgba(59, 130, 246, 0.15);
	border-left: 3px solid var(--accent-primary);
}

.sidebar-footer {
	padding: 1.5rem;
	border-top: 1px solid var(--glass-border);
}

.user-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.user-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	color: white;
	box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.user-name {
	font-weight: 600;
	font-size: 0.95rem;
}

.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 1rem;
	overflow-y: auto;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 2rem;
	border-radius: 12px;
	margin-bottom: 2rem;
}

.topbar h1 {
	font-size: 1.25rem;
}

.badge {
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.badge-success {
	background-color: rgba(16, 185, 129, 0.15);
	color: #34d399;
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.content-wrapper {
	padding: 0 1rem;
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
}

.welcome-banner {
	padding: 2.5rem;
	border-radius: 16px;
	margin-bottom: 2rem;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
	border-left: 4px solid var(--accent-primary);
}

.welcome-banner h2 {
	font-size: 1.75rem;
	margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.5rem;
}

.stat-card {
	padding: 1.5rem;
	border-radius: 16px;
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
}

.stat-card.interactive {
	transition: var(--transition-smooth);
	cursor: pointer;
}

.stat-card.interactive:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
	border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
	font-size: 2rem;
	background: rgba(255, 255, 255, 0.05);
	width: 60px;
	height: 60px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.stat-details h3 {
	font-size: 0.9rem;
	color: var(--text-muted);
	font-weight: 500;
}

.stat-value {
	font-size: 2rem;
	font-weight: 700;
	color: white;
	margin-top: 0.25rem;
	line-height: 1;
}

.recent-activity {
	padding: 2rem;
	border-radius: 16px;
}

code {
	background: rgba(0, 0, 0, 0.3);
	padding: 0.2rem 0.4rem;
	border-radius: 4px;
	color: #60a5fa;
	font-size: 0.9em;
}
