@font-face {
	font-family: "Mona Sans Expanded";
	src: url("../fonts/MonaSansExpanded-Black.woff2") format("woff2");
	font-weight: 900;
	font-display: swap;
}

body {
	--bg-primary: #11131a;
	--bg-secondary: #1d212b;
	--bg-tertiary: #2c3242;
	--accent-primary: #00ced1;
	--accent-secondary: #f7d000;
	--text-primary: #e1e1e1;
	--text-secondary: #a0a8b9;
	--status-green: #28e979;
	--status-red: #e92855;
	--header-bg: var(--bg-secondary);
	--header-border: var(--accent-primary);
	--header-text: var(--accent-primary);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",sans-serif;
	margin: 0;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	transition: background-color 0.3s ease, color 0.3s ease;
	overflow-x: hidden;
}

*:focus,
button[type="button"]:focus {
	outline: 2px solid #ed5b00;
	outline-offset: 1px;
}

[tabIndex="-1"] {
	outline: none;
}

header {
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	background-color: var(--header-bg);
	padding: 1rem 2rem;
	border-bottom: 2px solid var(--header-border);
	color: #fff;
	transition: background-color 0.3s ease, color 0.3s ease;
}

header h1 {
	font-family: "Mona Sans Expanded", sans-serif;
	margin: 0;
	font-size: 1.5rem;
	text-align: center;
	line-height: 1.4;
}

main {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 2rem;
}

#description {
	width: 100%;
	max-width: 1000px;
	padding: 2rem;
	text-align: center;
	color: #fff;
	font-size: 1.2rem;
	font-weight: 400;
	margin-bottom: 1rem;
	padding-top: 0;
	margin-top: 1rem;
}

#main-container {
	background-color: var(--bg-secondary);
	border: 1px solid var(--bg-tertiary);
	border-radius: 4px;
	width: 100%;
	max-width: 1000px;
	padding: 2rem;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
	transition: background-color 0.3s ease;
	margin: 0 auto;
}

#upload-box {
	display: none;
	text-align: center;
	border: 2px dashed var(--bg-tertiary);
	padding: 3rem;
	cursor: pointer;
	transition: all 0.3s ease;
	user-select: none;
}

#upload-box.active {
	display: block;
}

#upload-box:hover {
	border-color: var(--accent-primary);
	color: var(--accent-primary);
}

#upload-box .upload-icon {
	font-size: 0;
	margin-bottom: 1.2rem;
}

#upload-box p {
	margin: 0.5rem 0;
	color: var(--text-secondary);
}

#file-input {
	display: none;
}

#processing-area {
	display: none;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

#processing-area.active {
	display: grid;
}

.left-panel,
.right-panel {
	background-color: var(--bg-primary);
	padding: 1.5rem;
	border: 1px solid var(--bg-tertiary);
	transition: background-color 0.3s ease;
}

h2 {
	color: var(--accent-primary);
	margin-top: 0;
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 1rem;
}

#file-list {
	max-height: 250px;
	overflow-y: auto;
}

.file-item {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--bg-tertiary);
	font-size: 0.9rem;
	gap: 1rem;
}

.file-item:last-child {
	border-bottom: none;
}

.file-item.no-exif {
	opacity: 0.6;
}

.file-name {
	word-break: break-all;
}

.file-size {
	color: var(--text-secondary);
	white-space: nowrap;
}

.inspect-button {
	background: none;
	border: 1px solid var(--bg-tertiary);
	color: var(--text-secondary);
	font-size: 0.8rem;
	padding: 0.2rem 0.5rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.inspect-button:hover:not(:disabled) {
	border-color: var(--accent-secondary);
	color: var(--accent-secondary);
}

.inspect-button:disabled {
	border-color: var(--bg-primary);
	color: var(--text-secondary);
	cursor: default;
}

.options {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.toggle-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
}

.toggle-container.disabled {
	opacity: 0.5;
	pointer-events: none;
}

.option-desc {
	font-size: 0.8rem;
	color: var(--text-secondary);
	margin: -0.5rem 0 0.5rem;
}

.switch {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 24px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--bg-tertiary);
	transition: 0.4s;
}

.slider:before {
	position: absolute;
	content: "";
	height: 16px;
	width: 16px;
	left: 4px;
	bottom: 4px;
	background-color: white;
	transition: 0.4s;
}

.switch input:focus-visible + .slider {
	outline: 2px solid #ed5b00;
	outline-offset: 1px;
}

input:checked + .slider {
	background-color: var(--accent-primary);
}

input:checked + .slider:before {
	transform: translateX(26px);
}

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

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

#quality-control-area.disabled {
	opacity: 0.4;
	pointer-events: none;
}

.slider-container {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.5rem;
	margin-top: 0.5rem;
}

.slider-container span {
	font-size: 0.75rem;
}

#quality-slider {
	flex-grow: 1;
	-webkit-appearance: none;
	appearance: none;
	height: 5px;
	background: var(--bg-tertiary);
}

#quality-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 15px;
	height: 15px;
	background: var(--accent-primary);
	cursor: pointer;
	border-radius: 50%;
}

#quality-value {
	display: block;
	text-align: center;
	color: var(--accent-secondary);
	font-weight: 700;
}

.button {
	background: transparent;
	border: 2px solid var(--accent-primary);
	color: var(--accent-primary);
	padding: 0.8rem 1.5rem;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
	width: 100%;
	margin-top: 1rem;
	text-align: center;
}

.button:hover:not(:disabled) {
	background-color: var(--accent-primary);
	color: var(--bg-secondary);
	text-shadow: none;
}

.button:disabled {
	border-color: var(--bg-tertiary);
	color: var(--text-secondary);
	cursor: not-allowed;
}

.secondary-button {
	border-color: var(--bg-tertiary);
	color: var(--text-secondary);
}

.secondary-button:hover:not(:disabled) {
	background-color: var(--bg-secondary);
	border-color: #fff;
	color: #fff;
}

.container-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 0;
}

.loading {
	display: inline-block;
	border: 15px solid #ddd;
	border-top: 15px solid #00ced1;
	border-radius: 50%;
	width: 140px;
	height: 140px;
	animation: rotation 0.5s linear infinite;
}

@keyframes rotation {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

#loading-area,
#results-area {
	display: none;
}

#loading-area.active,
#results-area.active {
	display: block;
}

#results-table {
	background-color: var(--bg-primary);
	border: 1px solid var(--bg-tertiary);
	transition: background-color 0.3s ease;
}

.table-header,
.result-item {
	display: grid;
	grid-template-columns: 3fr 1fr 2fr 1.5fr;
	gap: 1rem;
	padding: 0.8rem;
	text-align: left;
}

.table-header {
	font-weight: 700;
	color: var(--accent-primary);
	border-bottom: 2px solid var(--accent-primary);
}

.result-item {
	border-bottom: 1px solid var(--bg-tertiary);
}

.result-item:last-child {
	border-bottom: none;
}

.status-success {
	color: var(--status-green);
}

.status-fail {
	color: var(--status-red);
}

.status-skipped {
	color: var(--text-secondary);
}

.size-increase {
	color: var(--status-red);
}

.size-decrease {
	color: var(--status-green);
}

.hidden {
	display: none!important;
}

#modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(17, 19, 26, 0.9);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

#modal-content {
	background-color: var(--bg-secondary);
	border: 1px solid var(--accent-primary);
	padding: 2rem;
	border-radius: 4px;
	width: 90%;
	max-width: 700px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	position: relative;
}

#modal-close-button {
	position: absolute;
	top: 10px;
	right: 15px;
	background: none;
	border: none;
	font-size: 2rem;
	color: var(--text-secondary);
	cursor: pointer;
}

#modal-title {
	color: var(--accent-secondary);
	margin: 0 0 1rem;
}

#modal-metadata {
	flex-grow: 1;
	overflow-y: auto;
	background-color: var(--bg-primary);
	padding: 1rem;
	font-size: 0.8rem;
	white-space: pre-wrap;
	word-break: break-all;
}

footer {
	background-color: var(--header-bg);
	padding: 1.5rem;
	text-align: center;
	border-top: 1px solid var(--bg-tertiary);
	color: var(--text-secondary);
	font-size: 0.8rem;
	transition: background-color 0.3s ease;
}

footer p {
	margin: 0;
}

footer a {
	color: #fff;
}

#credits {
	width: 100%;
	margin: 1em auto 0;
}

#credits p,
#credits ul {
	font-size: 1em;
	font-weight: 400;
	line-height: 1.2;
	margin-bottom: 1em;
	text-align: center;
}

#credits ul:last-child {
	list-style: none;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 0;
	flex-wrap: wrap;
}

#credits ul:last-child li {
	display: flex;
	align-items: center;
}

#credits ul:last-child > li:first-child > span {
	margin-left: 5px;
}

#credits ul:last-child a {
	margin: 0 5px;
}

#credits ul:last-child a.doc,
#credits .hub {
	display: inline-flex;
	font-size: 0;
	line-height: 0;
}

#credits ul:last-child a.doc {
	margin: 0 3px;
}

#credits .hub {
	margin-left: 3px;
	cursor: pointer;
}

#hub {
	position: fixed;
	visibility: hidden;
	opacity: 0;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: -1;
}

#hub.ouvert {
	visibility: visible;
	opacity: 1;
	animation: fonduEntrant linear 0.1s;
	z-index: 100000;
}

@keyframes fonduEntrant {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

#hub iframe {
	width: 100%;
	height: 100%;
}

#hub button {
	font-size: 0;
	color: #fff;
	position: absolute;
	top: 15px;
	right: 15px;
	cursor: pointer;
}

@media screen and (max-width: 599px) {
	html {
		font-size: 90%;
	}

	#hub button {
		top: 5px;
		right: 5px;
	}

	#hub button svg {
		width: 24px;
		height: 24px;
	}

	#description {
		font-size: 1.1rem;
	}
}

@media screen and (max-width: 399px) {
	h1 span {
		display: block;
	}
}

@media screen and (max-width: 999px) {
	#processing-area {
		grid-template-columns: 1fr;
	}

	.left-panel,
	.right-panel {
		width: 100%;
	}
}

.lecteur-ecran {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	*:not(.loading),
	*:not(.loading)::before,
	*:not(.loading)::after {
		animation-duration: 0.01ms!important;
		animation-iteration-count: 1!important;
		transition-duration: 0s!important;
		transition-delay: 0s!important;
		scroll-behavior: auto!important;
	}
}
