/* Modal dialogs and overlays */

/* --- Modern Command Palette --- */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.3);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	animation: fadeIn 0.15s ease-out;
}

/* Sidebar Layout Override */
.modal-overlay {
	align-items: center !important;
	padding-top: 0 !important;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes slideIn {
	from { 
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to { 
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.modal-content {
	background: var(--main-bg);
	padding: 0;
	border-radius: 16px;
	width: 850px;
	height: 643px;
	max-width: 95vw;
	max-height: 95vh;
	box-shadow: 
		0 25px 50px rgba(0, 0, 0, 0.15),
		0 0 0 1px rgba(255, 255, 255, 0.1);
	border: 1px solid var(--border-color);
	overflow: hidden;
	animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
	width: 850px !important;
	height: 643px !important;
	max-width: 95vw !important;
	max-height: 95vh !important;
	display: flex !important;
}

/* Sidebar Navigation */
.command-sidebar {
	width: 220px;
	background: var(--secondary-bg);
	border-right: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

/* Sidebar Header */
.sidebar-header {
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: 600;
	font-size: 16px;
	border-bottom: 1px solid var(--border-color);
}

.sidebar-header svg {
	width: 20px;
	height: 20px;
	stroke: var(--primary-color);
}

/* Sidebar Sections */
.sidebar-section {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
}

.sidebar-divider {
	height: 1px;
	background: var(--border-color);
	margin: 8px 16px;
}

/* Sidebar Categories */
.sidebar-category {
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	color: var(--text-muted-color);
	transition: all 0.2s ease;
	position: relative;
	font-size: 14px;
	font-weight: 500;
}

.sidebar-category:hover {
	background: rgba(0, 0, 0, 0.03);
	color: var(--text-color);
}

.sidebar-category.active {
	background: rgba(0, 0, 0, 0.05);
	color: var(--text-color);
}

.sidebar-category.active::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 24px;
	background: #10a37f;
	border-radius: 0 2px 2px 0;
}

.sidebar-category svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	flex-shrink: 0;
}

/* Account Section Container */
.sidebar-account-section {
	margin-top: auto;
	flex-shrink: 0;
	border-top: 1px solid var(--border-color);
}

/* Account Section */
.sidebar-account {
	padding: 16px;
	cursor: pointer;
	transition: background 0.2s ease;
	position: relative;
}

.sidebar-account:hover {
	background: rgba(0, 0, 0, 0.03);
}

.account-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.account-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(135deg, #667eea, #764ba2);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: 600;
	font-size: 14px;
}

.account-details {
	flex: 1;
}

.account-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-color);
}

.account-email {
	font-size: 14px;
	font-weight: 500;
	color: var(--text-color);
}

.account-role {
	font-size: 12px;
	color: var(--text-muted-color);
	margin-top: 2px;
}

/* Account Dropdown */
.account-dropdown {
	position: absolute;
	bottom: 60px;
	left: 16px;
	right: 16px;
	background: white;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	padding: 4px;
	z-index: 100;
}

.account-dropdown button {
	width: 100%;
	padding: 8px 12px;
	display: flex;
	align-items: center;
	gap: 12px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 14px;
	color: var(--text-color);
	transition: background 0.2s ease;
	border-radius: 4px;
}

.account-dropdown button:hover {
	background: rgba(0, 0, 0, 0.05);
}

.account-dropdown button svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
}

/* Dark mode adjustments for sidebar */
.dark-mode .command-sidebar {
	background: #1a1a1a;
	border-right-color: #333;
}

.dark-mode .sidebar-header {
	border-bottom-color: #333;
}

.dark-mode .sidebar-divider {
	background: #333;
}

.dark-mode .sidebar-category:hover {
	background: rgba(255, 255, 255, 0.05);
}

.dark-mode .sidebar-category.active {
	background: rgba(255, 255, 255, 0.1);
	color: var(--text-color);
}

.dark-mode .sidebar-category.active::before {
	background: #10a37f;
}

.dark-mode .sidebar-account-section {
	border-top-color: #333;
}

.dark-mode .sidebar-account:hover {
	background: rgba(255, 255, 255, 0.05);
}

.dark-mode .account-dropdown {
	background: #2a2a2a;
	border-color: #444;
}

.dark-mode .account-dropdown button:hover {
	background: rgba(255, 255, 255, 0.1);
}

.dark-mode .command-footer {
	background: #1a1a1a;
	border-top-color: #333;
}

/* Main Content Area */
.command-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.command-header {
	padding: 20px 30px;
	border-bottom: 1px solid var(--border-color);
	background: var(--secondary-bg);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.command-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
}

.command-body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
}

/* Command List Modern Styling */
.command-list {
	padding: 16px;
	max-height: 60vh;
	overflow-y: auto;
}

.command-list::-webkit-scrollbar {
	width: 4px;
}

.command-list::-webkit-scrollbar-track {
	background: transparent;
}

.command-list::-webkit-scrollbar-thumb {
	background: var(--border-color);
	border-radius: 3px;
}

.command-list::-webkit-scrollbar-thumb:hover {
	background: var(--text-muted-color);
}

.command-list button {
	display: flex;
	align-items: center;
	width: 100%;
	text-align: left;
	padding: 12px 16px;
	border: none;
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 400;
	color: var(--text-color);
	transition: all 0.15s ease;
	margin-bottom: 2px;
	position: relative;
}

.command-list button:hover {
	background: #f7f7f7;
}

.command-list button.selected {
	background: #f0f0f0;
	color: var(--text-color);
}

.command-list button.selected::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 24px;
	background: #10a37f;
	border-radius: 0 2px 2px 0;
}

.command-list hr {
	border: none;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--border-color), transparent);
	margin: 12px 0;
	opacity: 0.5;
}

/* Category headers */
.command-category {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted-color);
	padding: 12px 16px 6px;
	margin-bottom: 4px;
}

/* Special button styles */
.command-list button[data-command="showPlans"] {
	background: linear-gradient(135deg, #28a745, #20c997);
	color: white;
	font-weight: 500;
}

.command-list button[data-command="showPlans"]:hover {
	transform: translateX(2px) translateY(-1px);
	box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.command-list button[data-command="showAdminDashboard"] {
	background: linear-gradient(135deg, #dc3545, #e85d6e);
	color: white;
	font-weight: 500;
}

.command-list button[data-command="showAdminDashboard"]:hover {
	transform: translateX(2px) translateY(-1px);
	box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

/* Toast animations */
@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes slideOutRight {
	from {
		transform: translateX(0);
		opacity: 1;
	}
	to {
		transform: translateX(100%);
		opacity: 0;
	}
}

/* Command Footer */
.command-footer {
	padding: 12px 16px;
	border-top: 1px solid var(--border-color);
	background: var(--secondary-bg);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	font-size: 12px;
	color: var(--text-muted-color);
}

.command-footer .footer-shortcuts {
	display: flex;
	gap: 16px;
	align-items: center;
}

.command-footer .shortcut-item {
	display: flex;
	align-items: center;
	gap: 4px;
}

.command-footer .shortcut-key {
	background: var(--main-bg);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 11px;
	border: 1px solid var(--border-color);
	font-family: monospace;
}

/* Palette Footer (Legacy) */
.palette-footer {
	text-align: center;
	padding: 16px;
	border-top: 1px solid var(--border-color);
	font-size: 11px;
	color: var(--text-muted-color);
	background: var(--secondary-bg);
	opacity: 0.8;
}

/* Account Section Styling */
#command-account-section {
	background: linear-gradient(135deg, var(--primary-color), #4dabf7);
	padding: 20px;
	margin: 0;
	border-radius: 0;
	text-align: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#command-account-info {
	color: white;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 12px;
	opacity: 0.95;
}

#command-account-section button {
	background: rgba(255, 255, 255, 0.2);
	color: white;
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 8px 16px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: all 0.2s ease;
	backdrop-filter: blur(10px);
}

#command-account-section button:hover {
	background: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 0.5);
	transform: translateY(-1px);
}

/* Aurora Loading Screen */
.loading-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* Modern gradient background with analog texture */
.aurora-bg {
	position: absolute;
	width: 200%;
	height: 200%;
	top: -50%;
	left: -50%;
	background: 
		radial-gradient(ellipse at 30% 40%, rgba(16, 163, 127, 0.9) 0%, transparent 40%),
		radial-gradient(ellipse at 70% 60%, rgba(255, 220, 95, 0.8) 0%, transparent 40%),
		radial-gradient(ellipse at 10% 80%, rgba(120, 119, 255, 0.7) 0%, transparent 50%),
		radial-gradient(ellipse at 90% 20%, rgba(255, 119, 168, 0.6) 0%, transparent 50%);
	animation: aurora-shift 3s ease-in-out infinite;
	filter: blur(60px) contrast(1.2) saturate(1.5);
	opacity: 0.85;
	transform: scale(1.5) rotate(45deg);
}

/* Grain texture overlay */
.aurora-bg::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: 
		url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.15'/%3E%3C/svg%3E");
	background-repeat: repeat;
	mix-blend-mode: overlay;
	opacity: 0.4;
	animation: grain 8s steps(10) infinite;
}

/* Dynamic light burst */
.aurora-bg::after {
	content: '';
	position: absolute;
	width: 120%;
	height: 120%;
	top: -10%;
	left: -10%;
	background: 
		conic-gradient(
			from 0deg at 50% 50%,
			rgba(16, 163, 127, 0.4) 0deg,
			transparent 60deg,
			rgba(255, 220, 95, 0.3) 120deg,
			transparent 180deg,
			rgba(120, 119, 255, 0.3) 240deg,
			transparent 300deg,
			rgba(16, 163, 127, 0.4) 360deg
		);
	animation: burst-rotate 2s linear infinite;
	filter: blur(40px);
	mix-blend-mode: screen;
}

@keyframes aurora-shift {
	0%, 100% { 
		transform: scale(1.5) rotate(45deg) translate(0, 0);
		filter: blur(60px) contrast(1.2) saturate(1.5);
	}
	50% { 
		transform: scale(1.8) rotate(50deg) translate(-5%, 5%);
		filter: blur(80px) contrast(1.5) saturate(2);
	}
}

@keyframes burst-rotate {
	0% { 
		transform: rotate(0deg) scale(0.8);
		opacity: 0.6;
	}
	50% {
		transform: rotate(180deg) scale(1.2);
		opacity: 1;
	}
	100% { 
		transform: rotate(360deg) scale(0.8);
		opacity: 0.6;
	}
}

@keyframes grain {
	0%, 100% { transform: translate(0, 0); }
	10% { transform: translate(-2%, -2%); }
	20% { transform: translate(2%, 2%); }
	30% { transform: translate(-1%, 1%); }
	40% { transform: translate(1%, -1%); }
	50% { transform: translate(-2%, 2%); }
	60% { transform: translate(2%, -2%); }
	70% { transform: translate(-1%, -1%); }
	80% { transform: translate(1%, 1%); }
	90% { transform: translate(-2%, 1%); }
}

.loading-content {
	position: relative;
	z-index: 1;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.loading-spinner {
	width: 48px;
	height: 48px;
	position: relative;
	margin: 0 auto 24px;
}

.loading-spinner::before,
.loading-spinner::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid transparent;
	border-top-color: rgba(255, 255, 255, 0.8);
	animation: loading-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-spinner::after {
	animation-delay: -0.3s;
	border-top-color: rgba(255, 255, 255, 0.4);
	width: 80%;
	height: 80%;
	top: 10%;
	left: 10%;
}

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

.loading-text {
	color: rgba(255, 255, 255, 0.95);
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.5px;
	animation: fade-in-out 2.5s ease-in-out infinite;
	text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes fade-in-out {
	0%, 100% { 
		opacity: 0.7;
		transform: translateY(0);
	}
	50% { 
		opacity: 1;
		transform: translateY(-2px);
	}
}

/* Hide loading screen when loaded */
body.loaded .loading-screen {
	opacity: 0;
	transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: none;
}

/* Command Grid Layout */
.command-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
	padding: 20px;
}

.command-grid.two-column {
	grid-template-columns: repeat(2, 1fr);
}

.command-grid.three-column {
	grid-template-columns: repeat(3, 1fr);
}

.command-grid.four-column {
	grid-template-columns: repeat(4, 1fr);
}

/* Command Items */
.command-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--main-bg);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: center;
	min-height: 100px;
}

.command-item:hover {
	background: var(--secondary-bg);
	border-color: var(--primary-color);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.command-item .icon {
	font-size: 24px;
	margin-bottom: 8px;
	color: var(--primary-color);
}

.command-item .label {
	font-size: 14px;
	font-weight: 500;
	color: var(--text-color);
}

.command-item .shortcut {
	font-size: 12px;
	color: var(--text-muted-color);
	margin-top: 4px;
}

/* Dark mode adjustments for command grid */
.dark-mode .command-item {
	background: var(--main-bg);
	border-color: #444;
}

.dark-mode .command-item:hover {
	background: rgba(255, 255, 255, 0.05);
	border-color: var(--primary-color);
}