.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #ccc;
	border-top-color: #007bff; /* Bootstrap blue, or change to your theme color */
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 10px auto;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	font-family: 'Roboto', Arial, sans-serif;
	background-color: #f9f9f9;
	color: #333;
}

h1 {
	font-size: 2rem;
	color: #2b3a42;
	text-align: center;
	margin-bottom: 20px;
}

h2 {
	font-size: 1.4em;
	color: #2b3a42;
}

label {
	display: block;
	font-weight: bold;
	color: #555;
}

input[type="file"],
button {
	width: 100%;
	padding: 10px;
	margin-bottom: 15px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 1rem;
	box-sizing: border-box;
}

input[type="file"]:focus,
button:focus {
	outline: none;
	border-color: #4caf50;
	box-shadow: 0 0 5px rgba(76, 175, 80, 0.4);
}

#exif-container {
	/*grid-column: 1;*/
	/*grid-row: 2;*/
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px;
}


.editable {
	background-color: #eef;
}
 

input:checked + .slider {
	background-color: #2ab934;
}

input:focus + .slider {
	box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
	-webkit-transform: translateX(55px);
	-ms-transform: translateX(55px);
	transform: translateX(55px);
 }

.edit {
	display: none;
}

.edit,
.view {
	color: white;
	position: absolute;
	transform: translate(-50%,-50%);
	top: 50%;
	left: 50%;
	font-size: 10px;
	font-family: Verdana, sans-serif;
}

input:checked + .slider .edit {
	display: block;
}

input:checked + .slider .view {
	display: none;
}

.slider.round {
	border-radius: 34px;
}

.slider.round:before {
	border-radius: 50%;
}

input[readonly] {
	border: none !important;
	cursor: default;
	outline: none;
	user-select: none;
	pointer-events: none;
	font-family: inherit; /* Match the surrounding text */
	font-size: inherit; /* Keep the text size consistent */
	line-height: inherit; /* Match text height */
}

input:not([readonly]) {
	border: 1px solid #ccc;
	cursor: text;
	pointer-events: auto; /* Allow interactions when editable */
	font-family: inherit; /* Match the surrounding text */
	font-size: inherit; /* Keep the text size consistent */
	line-height: inherit; /* Match text height */
	background-color: #f3f3f3;
}

.drop-area {
	border: 2px dashed #ccc;
	padding: 20px;
	text-align: center;
	margin-bottom: 20px;
}

.drop-area.dragover {
	background-color: #f0f0f0;
}

.upload-section {
	background-color: #f0f7fb; /* Different background tone */
	border: 1px solid #b8d4e3;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 16px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.upload-section h2 {
	font-size: 1rem;
	color: #2a5c7d;
	margin-top: 0;
	margin-bottom: 8px;
	font-weight: 600;
}

.upload-section input[type="file"] {
	display: block;
	margin-top: 8px;
	font-size: 0.95em;
	background-color: #ffffff;
	padding: 6px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.upload-section label {
	display: block;
	margin-top: 8px;
	font-weight: 500;
	color: #333;
}

.upload-icon {
	font-size: 1.2em;
	color: #2a5c7d;
}

#preview {
	max-width: 100%;
	margin-top: 10px;
}

.undometadata, 
.deletemetadata {
	transition: background-color 0.2s, color 0.2s;
	background-color: white;
	width: 36px;
	height: 36px;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	border-radius: 4px;
	cursor: pointer;
	flex: 0 0 auto;
}

.undometadata {
	color: #007bff;
	border: 1px solid #007bff;
	font-size: 1.2em;
	transition: background-color 0.2s, color 0.2s;
	background-color: white;
}

.deletemetadata {
	color: #dc3545; /* Bootstrap danger red */
	border: 1px solid #dc3545;
	font-size: 0.9em;
	background-color: white;
	transition: background-color 0.2s, color 0.2s;
}

.undometadata:hover {
	background-color: #007bff;
	color: white;
	text-decoration: none;
}

.deletemetadata:hover {
	background-color: #dc3545;
	color: white;
	text-decoration: none;
}

.undometadata svg,
.deletemetadata svg {
	width: 20px;
	height: 20px;
	stroke: #333;
}

.deletemetadata.disabled .icon,
.undometadata.disabled .icon {
	color: #ccc;
	pointer-events: none;
	cursor: default;
}

footer.site-footer {
	font-size: 0.75rem;
	color: #666;
	text-align: center;
	padding: 10px 0;
	font-family: Arial, sans-serif;
	background: transparent;
	user-select: none;
}

footer.site-footer a {
	color: #666;
	text-decoration: none;
}

footer.site-footer a:hover,
footer.site-footer a:focus {
	text-decoration: underline;
}

.group-card {
	overflow: hidden;
	border: 1px solid #b0c4de;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 1em;
	width: 100%;
	max-width: 100%;
	height: fit-content;
	font-family: Arial, sans-serif;
	flex: 0 0 auto; 
	margin-top: 10px;
	box-sizing: border-box;
}

.group-card .content {
	padding: 0;
	border-collapse: collapse;
	width: 100%;
	background-color: #ffffff;
	margin: 0;
}

.original-value {
	color: #888;
	font-size: 0.85em !important; /* overides input[readonly] */
}

.original-value-div {
	visibility: hidden;
}

.original-value-div.visible {
	visibility: visible;
}

.results-header {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin-top: 32px;
	margin-bottom: 12px;
	border-bottom: 2px solid #d0e3ec;
	padding-bottom: 4px;
}

.results-header h2 {
	font-size: 1.4em;
	font-weight: 600;
	margin: 0;
	color: #2b3a42;
}

#thumbnail-container {
	min-width: 300px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 10px;
	margin-bottom: 10px;
}

.thumb-wrapper {
	position: relative;
	display: inline-block;
}

.thumb-image {
	max-width: 160px;
	max-height: 120px;
	border: 1px solid #ccc;
	border-radius: 8px;
}

.upload-error {
	background-color: #ffe0e0;
	color: #a00;
	padding: 10px;
	margin-bottom: 1em;
	border: 1px solid #d00;
	border-radius: 4px;
}

.upload-warnings {
	background-color: #fffbe0;
	color: #665500;
	padding: 10px;
	margin-bottom: 1em;
	border: 1px solid #ccc04d;
	border-radius: 4px;
}

.clear-session-button {
	background-color: #f0f0f0;
	color: #333;
	border: 1px solid #ccc;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
}

.clear-session-button:hover {
	background-color: #e0e0e0;
}

.command-centre {
	background-color: #f8f9fa;
	border: 1px solid #ccc;
	border-radius: 12px;
	padding: 1.5em;
	margin: 2em auto;
	max-width: 600px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.command-centre h2 {
	margin-top: 0;
	font-size: 1.4em;
	color: #333;
	text-align: center;
}

.command-centre form {
	margin-top: 1em;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.thumbheader {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	border-bottom: 1px solid #b0c4de;	/*Restored border between button and table */
	margin-bottom: 0px;
	border: 1px solid #ddd;
	border-radius: 5px;
	font-size: 1rem;
	box-sizing: border-box;
	background: #e6eff8;
}

.group-card span.thumbheaderinner {
	display: block;
	width: 100%;
	background-color: #e6eff8;
	color: #1c2e4a;
	border: none;
	padding: 12px 16px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	border-radius: 6px 6px 0 0;
	text-align: center; 
	margin: 0;
	line-height: 1.2;
}

header.minimal-header,
footer.minimal-footer {
	width: 100%;
	background: #ffffff;
	padding: 0.75rem 1rem;
	border-top: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
	box-sizing: border-box;
	font-size: 0.9rem;

	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
}

footer.minimal-footer {
	border-bottom: none;
}

header .logo {
	font-weight: bold;
	text-decoration: none;
	color: #333;
	font-size: 1.1rem;
}

header nav a,
footer nav a {
	margin: 0.25rem 0.5rem;
	text-decoration: none;
	color: #666;
	display: inline-block;
}

header nav a:hover,
footer nav a:hover {
	color: #000;
}

main {
	padding: 1rem;
}

main,
.content-wrapper {
	width: 100%;
	max-width: 800px; 
	margin: 0 auto;
	box-sizing: border-box;
}

.content-wrapper {
	flex: 1;
	display: grid;
	place-items: start center;
}

.tool-container {
	margin-top: 1rem;
}

.format-links {
	margin-top: 1rem;
	text-align: center;
}

.format-links a {
	margin: 0 0.5rem;
	text-decoration: none;
	color: #0077cc;
	font-size: 0.9rem;
}

.footer-container {
	width: 100%;
	background: #ffffff;
	padding: 0.75rem 1rem;
	border-top: 1px solid #e5e5e5;
	box-sizing: border-box;
	font-size: 0.9rem;

	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
}

.field-row {
	display: grid;
	grid-template-columns: minmax(8em, 12em) 1fr auto; /* responsive label column */
	gap: 0.5rem; /* reduce space between value and actions */
	align-items: center;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #ddd;
}

.field-label {
	font-weight: bold;
	width: 100%; /* allow grid cell to control width */
}

.field-value input[type="text"],
.field-value input[type="number"] {
	width: max-content;
	min-width: 4ch; 
	font-family: inherit;
	font-size: 1rem;
	border: 1px solid #ccc;
	padding: 4px 8px;
}

.field-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	max-width: 100%;
	gap: 2px;
}

.field-value {
	width: 100%;
	max-width: 100%;
}

.field-actions {
	display: flex;
	gap: 0.25rem;
	align-items: center;
	justify-content: flex-end;
}

.field-label,
.field-value,
.field-actions,
.field-wrapper {
	border-collapse: collapse;
	min-width:  0;
	max-width: 100%;
  	width: 100%;
}


@media (max-width: 600px) {
	.field-row {
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}

	.field-label {
		width: 100%;
		flex: 1 1 100%;
	}

	.field-wrapper {
	width: 100%;
	}

	.field-value {
		width: 100%;
		flex: 1 1 100%;
	}

	.field-actions {
		justify-content: flex-start;
		width: 100%;
		flex: 1 1 100%;
	}

	.content-wrapper {
		padding: 0 1rem;
	}

	.group-card {
		width: 100%;
	}
}

.content {
	box-sizing: border-box;
	width: 100%;
	border-collapse: collapse;
	padding: 0; /* Optional: remove extra space */
}

.thumbheaderinner {
	text-align: left;
}

.filetype-section {
  font-size: 14px;
  line-height: 1.5;
  margin-top: 0.5em;
}

.filetype-section h3 {
  margin: 0.5em 0 0.2em;
  font-size: 15px;
}

.filetype-section p {
  margin: 0;
  padding-left: 1em;
}

.hidden {
  display: none;
}

.expand {
  cursor: pointer;
  color: #0077cc;
  font-weight: bold;
  padding-left: 4px;
}

.format-links-horizontal {
  display: flex;
  gap: 2em;
  flex-wrap: wrap;
  padding: 1em 0;
  font-size: 0.95em;
}

.format-block {
  flex: 1 1 auto;
  min-width: 150px;
}

.format-block a {
  text-decoration: none;
  display: block;
  margin-bottom: 0.3em;
  font-weight: bold;
  color: #222;
}

.expand {
  cursor: pointer;
  color: #0077cc;
  font-weight: bold;
  padding-left: 4px;
}

.hidden {
  display: none;
}
