html, body {
	/* Reset the document's margin values */
	margin: 0;
	/* Reset the document's padding values */
	padding: 0;
	/* Use the platform's native font as the default */
	font-family: "Verdana", sans-serif;
	/* Define a reasonable base font size */
	font-size: 12pt;

	/* Use a non-white background color to make the content areas stick out from the full page box */
	background-color:  #3B3B3B; 
	color: #FAFAFA;
}

/* Styles that are shared by all elements */
* {
	/* Include the content box as well as padding and border for precise definitions */
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	
	margin: 0;
	padding: 0;
}

/* For top-level headings only */
h1 {
	/* Force page breaks after */
	page-break-before: always;
}
/* For all headings */
h1, h2, h3, h4, h5, h6 {
	/* Avoid page breaks immediately */
	page-break-after: avoid;
}
/* For all paragraph tags */
p {
	/* Reset the margin so that the text starts and ends at the expected marks */
	margin: 0;
}
/* For adjacent paragraph tags */
p + p {
	/* Restore the spacing between the paragraphs */
	margin-top: 0.5cm;
}
/* For links in the document */
a {
	/* Prevent colorization or decoration */
	text-decoration: none;
	color: #00FF00;
}
/* For tables in the document */
table {
	/* Avoid page breaks inside */
	page-break-inside: avoid;
}

ul { 
	list-style: none; 
	padding: 0; 
}

.row:after {
    content: "";
    display: table;
    clear: both;
}
.column { float: left; }
.w-10 { width: 10%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-15 { width: 15%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-50 {	width: 50%; }
.w-70 {	width: 70%; }
.w-100 { width: 100%; }
.p-2 { padding: 2px; }
.p-5 { padding: 5px; }
.p-10 { padding: 10px; }
.px-5 { padding-left: 5px; padding-right: 5px; }
.py-2 { padding-top: 2px; padding-bottom: 2px; }
.pb-10 { padding-bottom: 10px; }
.m-5 { margin: 5px; }
.m-10 { margin: 10px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.ml-20 { margin-left: 20px; }
.mr-10 { margin-right: 10px; }
.mr-20 { margin-right: 20px; }
.border { border: 1px solid #ccc; }
.border-dark { border-color: #333; }
.text-end { text-align: right; }
.spacer { margin-bottom: 20px; }
.fw-bold { font-weight: bold; }
.float-right { float: right; }

@page {
	size: A4;
	margin: 6mm;
}

/* Responsive layout - when the screen is less than 1200px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 1200px) {
	.column { width: 100%; }
}

@media screen {
	.report-content { display: none; }
}
@media print {
	* {
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
	
	html, body {
		width: 210mm;
		height: 297mm;
		margin: 0;
		padding: 0;
		display: flex;
		background-color: #fff;
		-webkit-print-color-adjust: exact;
	}
	
	.container { display: none; }
	
	.report-content { 
		width: 100%;
		padding: 6mm;
		color: #000;
		font-size: 12px;
		text-wrap: nowrap;
	}
	
	.report-content img { 
		width: 100%; 
		height: 100%; 
	}
	
	.report-header {
		font-size: 14px;
		text-wrap: wrap;
	}
	
	.report-title-field {
		background-color: #808080;
		color: #fff;
	}
	
	.report-content .border {
		margin-top: -1px;
		margin-left: -1px;
	}
}

.button {
	background-color: #04AA6D; /* Green */
	border: none;
	color: white;
	padding: 15px 32px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
}
.button1 {background-color: #04AA6D;} /* Green */
.button2 {background-color: #008CBA;} /* Blue */
.button3 {background-color: #f44336;} /* Red */
.button4 {background-color: #e7e7e7; color: black;} /* Gray */
.button5 {background-color: #555555;} /* Black */
.button6 {background-color: #FFA500;} /* Orange */

.table {
    display: table;
}

.table-unit {
	display: inline-block;
	float: left;
}

.table .title {
    display: table-caption;
}

.table .header {
    display: table-row;
    font-weight: bold;
    text-align: center;
}

.table .row {
    display: table-row;
}

.table .cell {
    display: table-cell;
    border: 1px solid #ccc;
    border-width: thin;
    padding: 5px 10px;
}

form .row {
    margin-bottom: 10px;
}

form .column {
    margin-right: 20px;
}

form label {
    margin-right: 10px;
}

form .column input[type=text], form .column select, form .column input[type=checkbox] {
    float: right;
}

form textarea {
    display: block;
}

form {
    margin-bottom: 20px;
    border-bottom: 2px solid #ccc;
}

form h2, form h4 {
    border-bottom: 2px solid #ccc;
	margin-bottom: 10px;
}

.sidebar {
    position: fixed; /* Fixed Sidebar (stay in place on scroll) */
    z-index: 1; /* Stay on top */
    background: #2B2B2B;
    height: 100%;
    width: 300px;
    left: 0;
    top: 0;
}
.sidebar a {
    color: #FAFAFA;
}
.sidebar .menu {
	padding: 10px 5px;
	margin-bottom: 15px;
}
.sidebar .menu ul li {
    margin-bottom: 5px;
}
.sidebar .menu ul li a {
    display: block;
    background-color: #3B3B3B;
    font-size: larger;
    text-align: center;
    padding: 15px 32px;
}
.sidebar .menu ul li a:hover {
    background-color: #ccc;
    color: #000;
}
.sidebar .info {
	padding: 0 5px;
	font-size: smaller;
	text-align: left;
}
.sidebar .info li {
	margin-bottom: 5px;
	display: block;
    background-color: #3B3B3B;
    padding: 10px;
}
.sidebar .input-container {
	background-color: #3B3B3B;
	margin: 0 0 5px 0;
	padding: 10px;
}
.sidebar label {
	margin-right: 10px;
	white-space: nowrap;
}
.sidebar input[type=text] {
	width: 100%;
	padding: 6px 10px;
	box-sizing: border-box;
	float: right;
}
.sidebar ul li p {
	margin: 0 0 5px 0;
	text-align: left;
}
.logo {
    background-image: url("/public/fls_calculus.jpg");
    background-repeat: no-repeat;
    background-size: 300px 195px;
    height: 195px;
}
.logo a {
    display: block;
    width: 300px;
    height: 195px;
}
.title {
    background: #2B2B2B;
    padding: 5px;
	text-align: center;
    font-weight: bold;
    font-size: larger;
	margin-bottom: 10px;
}
main { 
    position: absolute;
    left: 310px;
    top: 0;
    bottom: 0;
    right: 0;
}
main .content {
    padding: 5px;
}
.calculus-status {
    padding: 15px 32px;
    text-align: center;
    display: inline-block;
    font-size: 16px;
    background-color: #E7E7E7;
}
.controls p {
    font-size: 16px;
    margin: 0;
    color: #000;
}
.controls a.button:hover {
    background-color: #ccc;
    color: #000;
}
.results div p {
    float:left;
    width: 180px;
    font-size: 18px;
}
.image {
    padding: 5px;
}
.image img {
	border: 1px solid #ccc;
    width: 100%;
    height: 100%;
}
.textarea {
    background-color: #C1C1C1;
    padding: 10px;
}
.textarea pre {
    background-color: #3B3B3B;
    color: #FAFAFA;
    padding: 10px;
}
.counter-unit p.name {
	font-size: 18px;
	font-weight: bold;
	padding: 5px;
	margin: 0 10px 0 0;
	float: left;
}
.counter-unit .results {
	background-color: #2B2B2B;
	padding: 5px;
}
.counter-unit .results p {
	font-size: 14px;
	font-weight: bold;
	margin: 0;
	padding: 5px 0;
}
.counter-unit p.pausebutton {
	float: left; 
	margin: 0 0 5px 0;
}
.counter-unit p.pausebutton a {
	background-color: #008CBA; /* Blue */
	border: none;
	color: white;
	padding: 8px 24px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	font-size: 12px;
}
.input-label {
	display: inline-block;
	margin-right: 10px;
	margin-left: 10px;
}
.input-label_cage {
	display: inline-block;
	margin-right: 19px;        
	margin-left: 10px;     
}
.input-container {
    display: flex;
    margin-top:20px; 
    align-items: center; 
    margin-bottom: 20px; 
}

.chart-container {
	margin-bottom: 20px;
	padding: 10px;
	background-color: rgba(255, 255, 255, 0.8);
	border: 1px solid #ccc;
}
.chart-title {
    text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
}
.graph {
    margin-top:20px; 
    background-color: rgba(41, 144, 164, 0.4); 
    display: block;
}
.chart-dist {
	margin-left: 10px;
	padding: 2px;
	background-color: rgba(255, 255, 255, 0.8);
	border: 1px solid #ccc;
}
.chart-title-dist {
    text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
}

/* Style the tab */
.tab {
	overflow: hidden;
	margin-bottom: 10px;
}

/* Style the buttons that are used to open the tab content */
.tab button {
	background-color: #2B2B2B;
	color: #FAFAFA;
	float: left;
	border: none;
	outline: none;
	cursor: pointer;
	padding: 14px 16px;
	margin-right: 5px;
	font-size: larger;
}

/* Change background color of buttons on hover */
.tab button:hover {
	background-color: #ddd;
	color: #000;
}

/* Create an active/current tablink class */
.tab button.active {
	background-color: #ccc;
	color: #000;
}

/* Style the tab content */
.tabcontent {
	display: none;
}

/* Calibration Presets Styles */

.calibration-presets-selector .title {
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 20px;
}

.preset-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 30px;
	max-width: 800px;
}

.preset-card {
	background-color: #2B2B2B;
	border: 2px solid #555;
	border-radius: 8px;
	padding: 20px;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
}

.preset-card:hover {
	border-color: #04AA6D;
	background-color: #333;
}

.preset-card.active {
	border-color: #04AA6D;
	background-color: #04AA6D;
}

.preset-card.active::after {
	content: "✓";
	position: absolute;
	top: 10px;
	right: 15px;
	font-size: 20px;
	color: #FFF;
	font-weight: bold;
}

.preset-card.active h3,
.preset-card.active .fish-range,
.preset-card.active .counter-info,
.preset-card.active .calibration-values {
	color: #FFF;
}

.preset-card h3 {
	margin: 0 0 10px 0;
	font-size: 16px;
	color: #FAFAFA;
}

.preset-card .fish-range {
	font-size: 14px;
	color: #AAA;
	margin-bottom: 15px;
}

.preset-card .counter-info {
	font-size: 12px;
	color: #777;
	font-style: italic;
}

.preset-card .calibration-values {
	margin: 10px 0;
	font-size: 12px;
	color: #AAA;
}

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

.preset-card .calibration-item .counter-name {
	font-weight: bold;
}

.preset-card .calibration-item .values {
	font-size: 11px;
}

.preset-card .preset-actions {
	margin-top: 15px;
	display: flex;
	justify-content: center;
	gap: 10px;
}

.preset-card .btn-edit {
	background-color: #555;
	color: #FFF;
	border: none;
	padding: 8px 16px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 12px;
	width: 100%;
	text-align: center;
}

.preset-card .btn-edit:hover {
	background-color: #666;
}

.preset-card.active .btn-edit {
	background-color: rgba(255, 255, 255, 0.2);
}

.preset-card.active .btn-edit:hover {
	background-color: rgba(255, 255, 255, 0.3);
}

.preset-actions {
	text-align: left;
	margin-top: 30px;
}

/* Modal Styles */
.modal {
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
	background-color: #2B2B2B;
	margin: 2% auto;
	padding: 0;
	border-radius: 8px;
	width: 500px;
	max-width: 90%;
	max-height: 95vh;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.modal-header {
	background-color: #3B3B3B;
	padding: 20px;
	border-radius: 8px 8px 0 0;
	position: relative;
}

.modal-header h2 {
	margin: 0;
	color: #FAFAFA;
}

.close {
	position: absolute;
	right: 20px;
	top: 15px;
	font-size: 28px;
	font-weight: bold;
	color: #AAA;
	cursor: pointer;
}

.close:hover {
	color: #FFF;
}

.modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
	max-height: calc(95vh - 140px); /* Subtract header and footer height */
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 5px;
	color: #FAFAFA;
	font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 10px;
	background-color: #3B3B3B;
	color: #FAFAFA;
	border: 1px solid #555;
	border-radius: 3px;
	font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #04AA6D;
}

.form-group input[type="checkbox"] {
	width: auto;
	margin-right: 10px;
}

.modal-footer {
	background-color: #3B3B3B;
	padding: 20px;
	border-radius: 0 0 8px 8px;
	text-align: right;
}

.modal-footer .button {
	margin-left: 10px;
}

.button-secondary {
	background-color: #555 !important;
}

.button-secondary:hover {
	background-color: #666 !important;
}

.button-danger {
	background-color: #F44336 !important;
}

.button-danger:hover {
	background-color: #da190b !important;
}

/* Calibration sections in modal */
.calibration-section {
	border: 1px solid #555;
	border-radius: 5px;
	padding: 10px;
	margin: 10px 0;
	background-color: #333;
}

.counter-calibration-item {
	border: 1px solid #666;
	border-radius: 3px;
	padding: 8px;
	margin-bottom: 8px;
	background-color: #2B2B2B;
}

.counter-calibration-item h4 {
	margin: 0 0 8px 0;
	color: #04AA6D;
	font-size: 13px;
}

.form-group {
	margin-bottom: 15px;
}

.counter-calibration-item .form-group {
	margin-bottom: 10px;
}

/* Current calibration display */
.current-calibration-preset {
	font-weight: bold;
	color: #FAFAFA;
}