/* --- General & Typography --- */
body {
	font-family: 'Open Sans', sans-serif;
	background-color: #f7f9fc;
	margin: 0;
	color: #333;
}

h1,
h2,
h3 {
	color: #003865;
	margin-top: 20px;
}

a {
	color: #0072c6;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

/* --- Layout --- */
.body-wrapper {
	display: flex;
}

.main-content {
	margin-left: 220px;
	width: calc(100% - 220px);
	transition: margin-left 0.3s ease, width 0.3s ease;
}

header {
	background-color: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
	padding: 10px 30px;
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

/* --- Sidebar --- */
.sidebar {
	width: 220px;
	background: #003865;
	color: white;
	position: fixed;
	height: 100vh;
	padding: 20px;
	transition: width 0.3s ease;
}

.sidebar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
}

.sidebar-logo {
	height: 50px;
	/* Logo is bigger */
	transition: all 0.3s ease;
	z-index: 1;
}

.sidebar-menu {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sidebar-menu li {
	margin-bottom: 5px;
}

.sidebar-menu a {
	color: white;
	text-decoration: none;
	display: flex;
	align-items: center;
	padding: 12px 15px;
	border-radius: 6px;
	transition: background-color 0.2s ease;
	white-space: nowrap;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
	background-color: #ff6c2c;
}

.sidebar-menu a.active {
	pointer-events: none;
	/* This makes the link unclickable */
	cursor: default;
	/* This changes the mouse cursor to a standard arrow */
}

.sidebar-menu a i {
	margin-right: 15px;
	width: 20px;
	text-align: center;
	font-size: 1.1em;
}

.link-text {
	opacity: 1;
	transition: opacity 0.3s ease;
}

/* --- Collapsed Sidebar State --- */
.sidebar-collapsed .sidebar {
	width: 90px;
}

.sidebar-collapsed .main-content {
	margin-left: 90px;
	width: calc(100% - 90px);
}

/* Only hide the link text, logo stays visible */
.sidebar-collapsed .link-text {
	opacity: 0;
	visibility: hidden;
	width: 0;
}

.sidebar-collapsed #sidebar-toggle {
	/* This rule applies the .open state to the icon when the body has the collapsed class */
	/* This is for the initial page load */
	right: -26px;
	/* Adjust if your icon alignment is off */
}

.sidebar-collapsed #sidebar-toggle span {
	width: 30px;
	height: 20px;
	transform: rotate(0deg);
	background: #003865;
	border-radius: 0px;
}

.sidebar-collapsed #sidebar-toggle span:nth-child(1) {
	transform: rotate(135deg);
	top: 0px;
}

.sidebar-collapsed #sidebar-toggle span:nth-child(3) {
	transform: rotate(225deg);
	top: 14px;
}

/* --- Sidebar Toggle Button (Internal Style) --- */
#sidebar-toggle {
	width: 30px;
	height: 22px;
	position: relative;
	right: 0;
	transform: rotate(0deg);
	transition: 0.3s all ease-in-out;
	cursor: pointer;
	background: none;
	border: none;
}

#sidebar-toggle span {
	display: block;
	position: absolute;
	width: 26px;
	height: 4px;
	background: #ffffff;
	border-radius: 9px;
	opacity: 1;
	left: 0;
	transform-origin: left center;
	transition: 0.3s all ease-in-out;
}

/* Expanded State: ARROW < */
#sidebar-toggle span:nth-child(1) {
	transform: rotate(45deg);
	top: 4px;
}

#sidebar-toggle span:nth-child(2) {
	opacity: 0;
	width: 0;
}

#sidebar-toggle span:nth-child(3) {
	transform: rotate(-45deg);
	top: 6px;
}

/* Collapsed State: HAMBURGER ☰ */
#sidebar-toggle.open {
	right: -26px;
}

#sidebar-toggle.open span {
	width: 30px;
	height: 20px;
	transform: rotate(0deg);
	background: #003865;
	border-radius: 0px;
}

#sidebar-toggle.open span:nth-child(1) {
	transform: rotate(135deg);
	top: 0px;
}

#sidebar-toggle span:nth-child(2) {
	opacity: 0;
	width: 0;
}

#sidebar-toggle.open span:nth-child(3) {
	transform: rotate(225deg);
	top: 14px;
}

.header {
	display: flex;
	/* Use Flexbox for the main layout */
	justify-content: space-between;
	/* Pushes the left and right sides to opposite ends */
	align-items: center;
	/* Vertically aligns everything in the middle ✨ */
	padding: 10px 25px;
	/* Adds nice spacing on the top/bottom and left/right */
	background-color: #ffffff;
	/* A clean white background */
	border-bottom: 1px solid #e9ecef;
	/* A subtle bottom border for separation */
	gap: 20px;
	/* Ensures space between left/right if they get close */
}

/* 2. Right-Side Group (Username and Logout) */
.header-right {
	display: flex;
	/* Make this a flex container too */
	align-items: center;
	/* Vertically align the text and button */
	gap: 20px;
	/* This creates the perfect space between items!  Abstand */
}

/* 3. Ensure Consistent Look for Buttons */
.header .btn {
	/* Bootstrap's 'btn' class handles most of this, but we can ensure vertical alignment */
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	/* Prevents button text from wrapping */

}

/* 4. Style the Username Text */
.header .username {
	font-weight: 500;
	color: #495057;
}

#projectDropdown {
	margin-top: 0;
}

#projectDropdown,
#projectDropdown:focus,
#projectDropdown:active {
	background-color: #ff6c2c;
	/* Your desired background color */
	border-color: #ff6c2c;
	/* Makes the border match the background */
	color: #ffffff;
	/* Sets the text color to white for good contrast */
	box-shadow: none;
	/* Removes Bootstrap's default blue glow on click */
}

/* This handles the button's appearance when you hover over it */
#projectDropdown:hover {
	background-color: #e65c1c;
	/* A slightly darker shade for the hover effect */
	border-color: #e65c1c;
	/* Matching darker border on hover */
	color: #ffffff;
	/* Keep text color white */
}

/* --- Components (Tables, Progress Bars) --- */
table {
	width: 100%;
	border-collapse: collapse;
	margin: 30px 0;
	background-color: white;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

th,
td {
	padding: 12px 20px;
	border: 1px solid #ddd;
	text-align: center;
}

th {
	background-color: #003865;
	color: white;
}

td {
	background-color: #f9f9f9;
}

/* --- Forms --- */
form.login-container {
	background-color: white;
	max-width: 450px;
	margin: 40px auto;
	padding: 40px;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='file'],
select {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-sizing: border-box;
	font-size: 1rem;
}

button,
input[type='submit'] {
	width: 100%;
	padding: 12px 16px;
	/* margin-top: 10px; */
	font-size: 1rem;
	font-weight: bold;
	color: white;
	background-color: #ff6c2c;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

button:hover,
input[type='submit']:hover {
	background-color: #e55c1d;
}

/* --- Media Queries --- */
@media (max-width: 768px) {

	/* Remove reserved space for sidebar on mobile */
	.main-content {
		margin-left: 0 !important;
		width: 100% !important;
	}

	/* Hide sidebar by default on mobile - positioned off-screen at top */
	.sidebar {
		position: fixed;
		top: -100vh;
		left: 0;
		width: 100% !important;
		height: 100vh;
		z-index: 1000;
		padding: 20px;
		transition: top 0.3s ease;
		overflow-y: auto;
	}

	/* Show full sidebar when body has sidebar-open class */
	body.sidebar-open .sidebar {
		top: 0;
	}

	/* Show logo and link text when sidebar is open */
	body.sidebar-open .sidebar-logo,
	body.sidebar-open .link-text {
		opacity: 1;
		visibility: visible;
		width: auto;
	}

	/* Hide logo and link text when sidebar is closed */
	.sidebar-logo,
	.link-text {
		opacity: 0;
		visibility: hidden;
		width: 0;
	}

	/* Add overlay backdrop when sidebar is open */
	body.sidebar-open::before {
		content: '';
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.5);
		z-index: 999;
		animation: fadeIn 0.3s ease;
	}

	@keyframes fadeIn {
		from {
			opacity: 0;
		}

		to {
			opacity: 1;
		}
	}

	/* Reset mobile sidebar header layout */
	.sidebar-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: relative;
		margin-bottom: 20px;
		bottom: auto;
		right: auto;
		width: auto;
		height: auto;
		background: transparent;
		box-shadow: none;
	}

	body.sidebar-open .sidebar-header {
		position: relative;
		top: auto;
		right: auto;
		width: auto;
		height: auto;
		border-radius: 0;
		padding: 0;
		box-shadow: none;
		margin-bottom: 20px;
	}

	/* Floating Action Button for the Hamburger Menu */
	#sidebar-toggle, #sidebar-toggle.open {
		position: fixed !important;
		bottom: 20px !important;
		right: 20px !important;
		top: auto !important;
		left: auto !important;
		z-index: 1001 !important;
		background: #ff6c2c !important; /* High contrast orange */
		width: 56px !important;
		height: 56px !important;
		border-radius: 50% !important; /* Circle */
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
		display: flex !important;
		flex-direction: column !important;
		justify-content: center !important;
		align-items: center !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Reset the 3 lines for mobile FAB */
	#sidebar-toggle span,
	#sidebar-toggle.open span,
	#sidebar-toggle span:nth-child(1),
	#sidebar-toggle span:nth-child(2),
	#sidebar-toggle span:nth-child(3),
	#sidebar-toggle.open span:nth-child(1),
	#sidebar-toggle.open span:nth-child(2),
	#sidebar-toggle.open span:nth-child(3) {
		position: relative !important;
		display: block !important;
		width: 26px !important;
		height: 3px !important;
		background: #ffffff !important;
		margin: 3px 0 !important;
		transition: 0.3s all ease-in-out;
		opacity: 1 !important;
		transform: none !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		border-radius: 9px !important;
	}

	/* Form the "^" when sidebar is open (points UP to indicate sliding up) */
	body.sidebar-open #sidebar-toggle,
	body.sidebar-open #sidebar-toggle.open {
		position: absolute !important; /* Relative to .sidebar */
		top: 15px !important;
		right: 15px !important;
		bottom: auto !important;
		left: auto !important;
		background: transparent !important;
		box-shadow: none !important;
		width: 40px !important;
		height: 40px !important;
		transform: rotate(90deg) !important;
	}

	body.sidebar-open #sidebar-toggle span,
	body.sidebar-open #sidebar-toggle.open span {
		position: absolute !important;
		top: 50% !important;
		left: 50% !important;
		margin: 0 !important;
		width: 26px !important;
	}

	body.sidebar-open #sidebar-toggle span:nth-child(1),
	body.sidebar-open #sidebar-toggle.open span:nth-child(1) {
		transform: translate(-50%, -50%) rotate(45deg) !important;
	}

	body.sidebar-open #sidebar-toggle span:nth-child(2),
	body.sidebar-open #sidebar-toggle.open span:nth-child(2) {
		opacity: 0 !important;
	}

	body.sidebar-open #sidebar-toggle span:nth-child(3),
	body.sidebar-open #sidebar-toggle.open span:nth-child(3) {
		transform: translate(-50%, -50%) rotate(-45deg) !important;
	}

	/* Project dropdown - truncate with ellipsis */
	#projectDropdown {
		white-space: nowrap;
		text-align: left;
		max-width: 250px;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 8px 16px 8px 12px;
	}

	#projectDropdown strong {
		display: inline;
		margin-right: 4px;
	}

	header,
	.container,
	form {
		padding: 15px;
	}

	.header {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding-bottom: 20px;
	}

	.header-right {
		flex-direction: column;
		width: 100%;
		gap: 15px;
		align-items: center;
	}

	.header-right .btn {
		width: 100%;
		justify-content: center;
	}

	#projectDropdown {
		white-space: normal;
		text-align: center;
		width: 100%;
		max-width: 100%;
	}

	/* Prevent body scroll when sidebar is open */
	body.sidebar-open {
		overflow: hidden;
	}
}

.progress-label-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 0.9rem;
}

.progress-percentage {
	font-weight: 600;
	color: #003865;
}

.progress {
	background-color: #e9ecef;
	border-radius: 6px;
	height: 12px;
	/* You can adjust height here */
}

.progress-bar {
	background-image: linear-gradient(45deg, #0072C6, #005a9e);
}

.no-transition * {
	transition: none !important;
}

/* Style the form labels for better readability and accessibility */
.user-admin-form .form-label {
	font-weight: 600;
	margin-bottom: 8px;
	/* Adds space between label and input */
	color: #003865;
}

/* Ensure form controls from Bootstrap have consistent styling */
.user-admin-form .form-control,
.user-admin-form .form-select {
	padding: 10px 15px;
	font-size: 1rem;
	border-radius: 6px;
	border: 1px solid #ced4da;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Add a subtle focus effect for better accessibility */
.user-admin-form .form-control:focus,
.user-admin-form .form-select:focus {
	border-color: #ff6c2c;
	box-shadow: 0 0 0 0.25rem rgba(255, 108, 44, 0.2);
	/* Orange glow */
}

/* Style the project assignment checkbox area */
.project-assignment-box {
	background-color: #f8f9fa;
	/* Light background */
	border: 1px solid #dee2e6;
	border-radius: 6px;
	padding: 15px;
	max-height: 200px;
	overflow-y: auto;
	/* Enable scrolling for many projects */
}

.project-assignment-box .form-check {
	padding: 5px 0;
	/* Add spacing between checkboxes */
}

/* Make the action buttons not full-width for a cleaner look */
.user-admin-form .btn {
	width: auto;
	padding-left: 25px;
	padding-right: 25px;
}

.project-assignment-box {
	max-height: 250px;
	/* Increased max-height */
	padding: 10px 40px;
	/* Adjusted padding */
}

/* Add a small margin below each checkbox line to prevent them from getting cut off */
.project-assignment-box .form-check {
	margin-bottom: 2px;
}

.form-actions {
	display: flex;
	/* Use Flexbox for alignment */
	align-items: center;
	/* Vertically aligns the buttons in the middle ✨ */
	gap: 10px;
	/* Creates a nice space between the buttons */
}

/* Utility to override full-width buttons */
.fit-content {
	width: auto !important;
}