/* Shared Sidebar Navigation Styles */

/* Reset and base styles */
body {
	margin: 0;
	padding: 0;
	overflow-x: hidden;
}

/* Mobile sticky header */
.mobile-header {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: #f1f7ff;
	border-bottom: 1px solid #e2e8f0;
	z-index: 60;
	/* box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1); */
}

.mobile-header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 1rem;
}

.mobile-menu-btn {
	background: none;
	border: none;
	padding: 0.5rem;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
}

.mobile-menu-btn:hover {
	background: #f1f5f9;
}

.mobile-header-logo {
	height: 32px;
	width: auto;
}

.mobile-header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Mobile badge adjustments */
@media (max-width: 640px) {
	.mobile-header-actions .premium-badge,
	.mobile-header-actions .free-badge {
		font-size: 0.6rem;
		padding: 0.25rem 0.5rem;
	}
	
	.mobile-header-actions .premium-badge i,
	.mobile-header-actions .free-badge i {
		font-size: 0.6rem;
		margin-right: 0.25rem;
	}
	
	/* Notification button styling */
	#notificationBtn {
		position: relative;
	}
	
	#notificationBtn:hover {
		background: #f3f4f6;
	}
}

/* Prevent FOUC (Flash of Unstyled Content) on hard refresh */
.main-content {
	margin-left: 280px;
	min-height: 100vh;
	transition: margin-left 0.3s ease;
}

/* Sidebar navigation */
.sidebar {
	width: 280px;
	background: white;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100vh;
	overflow: hidden;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 40;
}

.sidebar-content {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding-bottom: 100px; /* Increased space for user info */
	min-height: 0; /* Allow flex shrinking */
	scroll-behavior: smooth;
}

.sidebar-content::-webkit-scrollbar {
	width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
	background: #f1f5f9;
}

.sidebar-content::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

.sidebar-link {
	position: relative;
	display: flex;
	align-items: center;
	padding: 12px 20px;
	margin: 4px 12px;
	border-radius: 12px;
	color: #64748b;
	text-decoration: none;
	transition: all 0.2s ease;
	font-weight: 500;
}

.sidebar-link:hover {
	background: #f1f5f9;
	color: #0284c7;
	transform: translateX(4px);
}

.sidebar-link.active {
	background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
	color: white;
}

.sidebar-link.active:hover {
	transform: none;
}

.sidebar-user-info {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: white;
	border-top: 1px solid #e2e8f0;
	padding: 16px;
	z-index: 10;
	box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}


/* Mobile overlay */
.sidebar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 40;
}

.sidebar-overlay.show {
	opacity: 1;
	visibility: visible;
}

/* Responsive design */
@media (max-width: 768px) {
	.mobile-header {
		display: block;
	}
	
	.main-content {
		margin-left: 0;
		padding-top: 60px; /* Account for mobile header height */
	}
	
	.sidebar {
		z-index: 50;
		transform: translateX(-100%);
		top: 60px; /* Start below mobile header */
		height: calc(100vh - 60px);
	}
	
	.sidebar.open {
		transform: translateX(0);
	}
}

@media (max-width: 640px) {
	.sidebar {
		width: 100%;
		max-width: 300px;
	}
	
	.sidebar-content {
		padding-bottom: 120px; /* Extra space on mobile for better visibility */
	}
}

@media (max-height: 600px) {
	/* For very short screens, reduce padding */
	.sidebar-content {
		padding-bottom: 90px;
	}
	
	.sidebar-user-info {
		padding: 12px 16px;
	}
}

/* Mobile touch scrolling improvements */
@media (max-width: 1024px) {
	.sidebar-content {
		-webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
		overscroll-behavior: contain; /* Prevent body scroll */
	}
	
	/* Ensure scroll indicators are visible on mobile */
	.sidebar-content::-webkit-scrollbar {
		width: 6px;
	}
	
	.sidebar-content::-webkit-scrollbar-thumb {
		background: #94a3b8;
		border-radius: 3px;
	}
}

/* Submenu Styles - Desktop Only */
.sidebar-submenu-container {
	position: relative;
}

.sidebar-parent {
	position: relative;
	display: flex !important;
	align-items: center;
}

.submenu-arrow {
	transition: transform 0.2s ease;
	font-size: 0.8rem;
	margin-left: auto;
}

.submenu-arrow.rotated {
	transform: rotate(180deg);
}

.submenu {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 8px;
	margin-top: 4px;
	margin-left: 12px;
}

.submenu.expanded {
	max-height: 200px;
	opacity: 1;
}

.submenu-item {
	padding: 8px 16px;
	font-size: 14px;
	margin-bottom: 2px;
	border-radius: 6px;
}

.submenu-item:hover {
	background: rgba(255, 255, 255, 0.1);
}

.submenu-item.active {
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
}