/* General Styles */
body, html {
	height: 100%;
	margin: 0;
	background-color: #e8e8e8;
	overflow-x: hidden;
}

.d-flex {
	display: flex;
}

.text-center {
	text-align: center;
}

/* Sidebar stays in place */
.sidebar {
	width: 250px;
	height: 100vh;
	position: fixed;
	top: 0;
	left: 0;
	background-color: #f8f9fa;
	overflow-y: auto;
}

/* Research Section Scrollability */
.research-section {
	flex-grow: 1;
	overflow-y: auto; /* Make the research tree scrollable */
	padding: 20px;
	margin-left: 250px; /* Room for the sidebar */
	margin-right: 250px; /* Room for the info bar */
	box-sizing: border-box;
	height: 100vh; /* Ensure full height for the scrollable section */
}

/* Main Content */
.main-content-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	padding: 40px;
	max-width: calc(100% - 500px); /* Room for both sidebar and right info bar */
}

/* Research Table */
.research-tree-table td {
	padding: 30px;
	text-align: center;
	vertical-align: middle;
	border-left: 1px solid rgba(0, 0, 0, 0.1); /* Light border between columns */
	border-right: 1px solid rgba(0, 0, 0, 0.1); /* Light border on the right */
	background-color: #fff;
}

.research-tree-table tr:nth-child(even) td {
	background-color: #f9f9f9; /* Alternate row background color */
}

.research-tree-table {
	border: 1px solid rgba(0, 0, 0, 0.1); /* Outer border */
}

/* Research Card */
.research-card {
	padding: 15px;
	background-color: #fff;
	border-radius: 10px;
	box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.research-card h5 {
	font-size: 1.1rem;
}

.research-card p {
	font-size: 0.9rem;
}

/* Research Square */
.research-square {
	width: 80px;
	height: 80px;
	border-radius: 5px;
	display: block;
}

/* Button Group */
.button-group {
	display: flex;
	gap: 5px;
}

.button-group .btn {
	width: 35px;
	height: 35px;
	padding: 0;
}

/* Ensure the research square, name, level, and buttons are aligned vertically */
.left-side {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.research-square,
.research-item-name,
.research-item-level,
.button-group {
	margin-bottom: 10px;
	text-align: center;
}

/* Smaller +/- Buttons */
.square-btn {
	width: 30px;
	height: 30px;
	padding: 0;
	text-align: center;
	line-height: 30px;
	display: inline-block;
}

/* Research Item Layout */
.research-item-container {
	display: flex;
	justify-content: space-between;
}

.research-item-left,
.research-item-right {
	width: 50%;
	padding: 5px;
	box-sizing: border-box;
}

/* Right Side: Resources and Time */
.research-item-right {
	display: grid;
	grid-template-columns: 50% 50%;
}

/* Resources and Time Display */
.resource-costs {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.resource-item {
	display: flex;
	justify-content: space-between;
	width: 100%;
	margin-bottom: 5px;
}

.resource-item-left {
	display: flex;
	align-items: center;
}

.resource-item-right {
	display: flex;
	justify-content: flex-end;
	padding-right: 20px; /* Prevent sticking to the edge */
	text-align: right;
}

.resource-item img {
	width: 20px;
	height: 20px;
	margin-right: 5px;
}

/* Time Required Styling */
.time-required {
	margin-top: 10px;
	text-align: center;
}


#info-bar {
	position: relative;
	height: 100%;
}

/* Info/Display Bar (Fixed in Place) */
.info-bar {
	width: 250px;
	background-color: #f0f0f0;
	padding: 20px;
	box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
	position: fixed;
	right: 0;
	top: 0;
	bottom: 0;
	overflow-y: auto; /* Add scroll if content overflows */
}

.info-bar h4 {
	margin-bottom: 20px;
	color: #007bff;
}

.info-bar p {
	color: #333;
}

/* Active Button Styling */
.btn.active {
	background-color: #28a745;
	color: white;
	border-color: #28a745;
}

.btn.active:hover {
	background-color: #218838;
}

/* Button Padding */
.btn {
	min-width: 60px;
	padding: 10px 20px;
}
/* Stat Increase Styling */
.stat-increase-info {
	margin-top: 10px;
	text-align: left; /* Align text to the left */
}

.stat-item {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
}

.stat-label {
	flex: 1;
	text-align: left; /* Ensure the stat name is aligned to the left */
	font-weight: bold;
}

.stat-value {
	flex: 1;
	text-align: right; /* Ensure the stat value is aligned to the right */
	color: green; /* Optional: color to distinguish positive stat addition */
}

/* Ensure the debug table is visible and placed at the bottom of the page */
#debug-table {
    width: 100%;            /* Make sure the table takes up full width */
    margin-top: 20px;       /* Add some spacing above the table */
    background-color: #fff; /* Background color for visibility */
    border-collapse: collapse; /* Collapse borders for table */
    text-align: center;     /* Center the text */
}

/* Ensure proper padding and border visibility */
#debug-table td, #debug-table th {
    padding: 10px;
    border: 1px solid #ddd; /* Add light border around the cells */
}

/* Add a fixed position at the bottom of the page */
#debug-table {
    position: relative; /* or use position: absolute/fixed depending on your layout */
    bottom: 0;
    z-index: 1000;      /* Ensure it is not overlapped by other elements */
}

/* Optional: Adjust table header background and styling */
#debug-table th {
    background-color: #007bff;
    color: white;
}

/* Ensure the buttons for mode and tabs are spaced out and styled properly */
.mode-selector .btn, .tab-selector .btn {
	margin-right: 10px;
}




.total-resource-time-box {
	border-top: 1px solid #ccc;
	background-color: #f9f9f9;
	padding: 10px;
}

#researchSpeedInput {
	width: 35%; /* Adjust this value as necessary */
}


.requirement-met {
    color: green;
}
.requirement-not-met {
    color: red;
}
.requirements-section {
	text-align: center; /* Center the entire section */
	margin-bottom: 10px; /* Add some spacing between sections */
}

.requirements-section b {
	display: block; /* Ensure the title (Research/Building) is on its own line */
	margin-bottom: 5px; /* Add some space between the title and items */
}

.requirement-item {
	display: block; /* Make each item appear on its own line */
	margin-bottom: 5px; /* Add some spacing between items */
	text-align: center; /* Center the text within each item */
}