/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* CSS Variables for Monochromatic Light Theme */
:root {
	--background-color: #f5f5f5; /* Light background */
	--box-background: #ffffff; /* White boxes */
	--text-color: #1a1a1a; /* Dark text for high contrast */
	--primary-color: #4d4d4d; /* Dark gray for primary elements */
	--secondary-color: #666666; /* Medium gray for secondary elements */
	--accent-color: #999999; /* Light gray for accents */
	--notification-color: #e0e0e0; /* Light gray for notifications */
	--table-header-bg: #dddddd; /* Light gray for table headers */
	--table-header-text: #1a1a1a; /* Dark text in table headers */
	--button-hover-bg: #cccccc; /* Light gray on hover */
	--button-bg: #bbbbbb; /* Gray background for buttons */
	--button-text: #1a1a1a; /* Dark text on buttons */
	--input-background: #ffffff; /* White input backgrounds */
	--input-text: #1a1a1a; /* Input text color */
	--link-color: #0066cc; /* Blue color for links if any */
	--label-color: #333333; /* Dark gray for labels */
	--summary-text-color: #1a1a1a; /* Dark text for summary sections */
	--table-text-color: #1a1a1a; /* Dark text for table texts */
	--table-background: #ffffff; /* White background for payout table */
	--summary-background: #ffffff; /* White background for summary sections */
}

/* Global Styles */
body {
	background-color: var(--background-color);
	font-family: 'Roboto', sans-serif;
	color: var(--text-color);
	margin: 0;
	min-height: 100vh;
	transition: background-color 0.3s ease, color 0.3s ease;
	display: flex;
	flex-direction: column; /* Stack children vertically */
}

/* Header Styling */
header.section {
	padding-top: 10px;
	padding-bottom: 10px;
	background-color: var(--box-background);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	justify-content: center; /* Ensure the content inside is centered */
}

/* Center the text within the header */
header.section .has-text-centered {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	text-align: center;
	padding: 20px 0;
}

/* Title Styling */
header .title {
	font-size: 2rem; /* Increased font size for visibility */
	font-weight: 700; /* Bold text */
	line-height: 1.2; /* Improved spacing */
	color: var(--primary-color); /* Uses the variable for color */
	transition: color 0.3s ease;
}

header .title:hover {
	color: var(--accent-color); /* Subtle hover effect for interactivity */
}

/* Box Styling */
.box {
	background-color: var(--box-background);
	color: var(--text-color);
	border-radius: 8px;
	padding: 25px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Label Styling */
.label {
	color: var(--label-color);
	font-weight: 500;
}

/* Label Icon Spacing */
.label i {
	margin-right: 8px;
	color: var(--primary-color);
}

/* Input Fields Styling */
.input {
	background-color: var(--input-background);
	color: var(--input-text);
	border: 1px solid var(--primary-color);
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.input::placeholder {
	color: var(--secondary-color);
}

.input:focus {
	border-color: var(--accent-color);
	box-shadow: 0 0 5px var(--accent-color);
}

/* Button Enhancements */
button.custom-button {
	background-color: var(--button-bg);
	color: var(--button-text);
	border: none;
	padding: 12px 20px;
	font-size: 1em;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease;
}

button.custom-button:hover {
	background-color: var(--button-hover-bg);
}

button.custom-button:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(85, 85, 85, 0.5);
}

/* Radio Buttons Styling */
input[type='radio'] {
	margin-right: 5px;
}

label.radio {
	color: var(--text-color);
}

label.radio input[type='radio']:focus + span {
	outline: 2px solid var(--accent-color);
}

/* Notification Styling */
.notification {
	margin-top: 20px;
	border-left: 5px solid var(--accent-color);
	background-color: var(--notification-color);
	animation: fadeIn 0.5s ease-in-out;
	transition: background-color 0.3s ease, border-left-color 0.3s ease;
	color: var(--text-color);
}

/* Faction Info Styling */
#factionInfo {
	margin-bottom: 20px;
	border-left-color: var(--accent-color);
	animation: fadeIn 0.5s ease-in-out;
	color: var(--text-color);
}

/* Summary Box Styling */
#summaryBox {
	background-color: var(--summary-background);
	border-left: 5px solid var(--accent-color);
	transition: background-color 0.3s ease, border-left-color 0.3s ease;
	color: var(--summary-text-color);
	padding: 1.5rem;
}

/* Summary Sections */
.summary-section {
	margin-bottom: 2rem; /* Consistent spacing between major sections */
}

.summary-section:last-child {
	margin-bottom: 0; /* Remove margin from last section */
}

.summary-section h3 {
	margin-top: 0;
	margin-bottom: 1rem;
	color: var(--primary-color);
	font-size: 1.25rem;
}

.summary-section p {
	margin-bottom: 1rem;
}

/* Calculation Explanations */
.calculation {
	font-size: 0.875em;
	color: var(--secondary-color);
	margin-left: 1em;
}

/* Pay Distribution Specific Styling */
.summary-hits,
.summary-respect-details {
	margin-top: 0;
	padding: 0 0 0 0;
	background-color: transparent;
	border-radius: 0;
	animation: none;
	color: var(--summary-text-color);
}

.summary-hits p,
.summary-respect-details p {
	margin-bottom: 1rem;
}

/* Table Header Styling */
table th {
	background-color: var(--table-header-bg);
	color: var(--table-header-text);
	text-align: center;
	padding: 12px;
	font-weight: 600;
}

/* Table Data Styling */
table td {
	background-color: var(--table-background);
	color: var(--table-text-color);
	text-align: center;
	padding: 10px;
}

/* Table Row Hover Effect */
table tbody tr:hover {
	background-color: #eeeeee;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

/* Loading Overlay Styling */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(245, 245, 245, 0.95); /* Light overlay */
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
	transition: background-color 0.3s ease;
}

.loading-overlay .spinner {
	text-align: center;
	color: var(--accent-color);
}

.loading-overlay .spinner p {
	margin-top: 10px;
	font-size: 1.2em;
	font-weight: 500;
	color: var(--accent-color);
}

/* Spinner Animation */
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Fade In Animation */
@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* Slide Down Animation */
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}

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

/* Fade In Box Animation */
@keyframes fadeInBox {
	from {
		opacity: 0;
		transform: scale(0.95);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Table Container Styling */
.table-container {
	overflow-x: auto;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	padding: 15px;
	background-color: var(--box-background);
	animation: fadeIn 0.5s ease-in-out;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	position: relative;
	z-index: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
	#summaryBox {
		padding: 1rem;
	}

	/* Consistent spacing for all sections */
	.summary-section,
	#summaryBox .summary-section {
		margin-bottom: 1.5rem;
	}

	/* Remove margin from last section */
	.summary-section:last-child,
	#summaryBox .summary-section:last-child {
		margin-bottom: 0;
	}

	.summary-section h3 {
		margin-bottom: 0.75rem;
	}

	/* Consistent spacing for all paragraph elements */
	.summary-section p,
	.summary-hits p,
	.summary-respect-details p {
		margin-bottom: 0.5rem;
	}

	/* Remove margin from last paragraphs */
	.summary-section p:last-child,
	.summary-hits p:last-child,
	.summary-respect-details p:last-child {
		margin-bottom: 0;
	}

	/* Stack sections vertically */
	#summaryBox .columns {
		flex-direction: column;
		margin-bottom: 1.5rem;
	}

	#summaryBox .columns:last-child {
		margin-bottom: 0;
	}

	/* Ensure all sections have same width */
	#summaryBox .summary-section {
		width: 100%;
	}
}

/* Additional Styles for Section Headings */
.summary-section h3 {
	font-size: 1.25rem;
	margin-bottom: 0rem;
}

@media (min-width: 769px) {
	/* Ensure Payout Totals and Stat Totals are side by side on desktop */
	#summaryBox .columns {
		display: flex;
		justify-content: space-between;
	}

	#summaryBox .summary-section {
		width: 48%;
	}
}

@media (max-width: 768px) {
	/* Stack Payout Totals and Stat Totals vertically on mobile */
	#summaryBox .columns.is-multiline {
		flex-direction: column;
	}

	#summaryBox .summary-section {
		width: 100%;
	}
}

/* Amount Payable Section Styling */
.amount-payable-section {
	padding: 1rem;
	margin-bottom: 1.5rem;
	border-bottom: 2px solid var(--accent-color);
}

.amount-payable-section p {
	color: var(--primary-color);
	margin: 0;
}

/* Add this at the bottom of your styles.css file */

.footer {
	background-color: var(--background-color);
	padding: 1rem;
	margin-top: auto; /* Push footer to bottom */
}

.footer .content.has-text-centered {
	display: flex;
	justify-content: flex-end;
	padding-right: 1rem; /* Add some padding from the right edge */
}

.footer p {
	margin: 0;
	color: var(--secondary-color);
	font-size: 0.875rem;
}

/* Add these styles to ensure proper stacking context */
.section {
	position: relative;
	z-index: 1;
}

.table-container {
	position: relative;
	z-index: 1;
}
