body {
	/* Full-page background with subtle blur to push focus to acrylic panels */
	background-image: url('../static/fundo.jpg');
	backdrop-filter: blur(5px);
	background-size: cover;
	background-position: center;
	background-attachment: fixed;
	background-repeat: no-repeat;
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;	
	font-family: Arial, sans-serif;
}

* , *::before, *::after {
	/* Use border-box so padding and borders are included in width/height calculations.
	   This ensures `.controls` matches `.image-viewer` width visually (no overflow
	   from borders/padding making it look wider). */
	box-sizing: border-box;
}

.container {
	/* Main acrylic container */
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	padding: 20px;
	background-color: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	width: 100%;
	max-width: 1300px;
	margin: 20px;
}

.image-viewer {
	/* Acrylic viewport for the image */
	width: 90%;
	aspect-ratio: 16/9;
	overflow: hidden;
	border-radius: 12px;
	background-color: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

#err-msg-view {
	/* Error banner layered above the image */
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80%;
	max-width: 400px;
	height: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	color: #c53030;
	font-size: 16px;
	font-weight: bold;
	text-align: center;
	background-color: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.5);
	padding: 15px;
	border-radius: 10px;
	z-index: 2;
	display: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.spinner {
	/* Centered loading spinner */
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	border: 5px solid rgba(255, 255, 255, 0.35);
	border-top: 5px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 2;
	display: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#current-image {
	/* Make the image fit while preserving its aspect ratio */
	width: 95%;
	height: 100%;
	object-fit: contain;
}

.controls {
	/* Acrylic controls panel */
	background-color: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	display: flex;
	gap: 12px;
	padding: 14px;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	flex-wrap: wrap;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
	width: 90%;
}

.btn {
	/* Base button: glass pill with high-contrast content */
	padding: 10px 16px;
	font-size: 16px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.9);
	color: #333;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	height: 44px;
	min-width: 96px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#timestamp-btn {
	/* Display-only timestamp as a neutral pill */
	pointer-events: none;
	user-select: none;
	min-width: 140px;
	font-variant-numeric: tabular-nums;
}

.btn:hover {
	background-color: #fff;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.2);
}

#prev-btn, #next-btn {
	/* Primary actions: solid accent */
	background: linear-gradient(180deg, #3b82f6, #2563eb);
	color: #fff;
	border: none;
	font-weight: 600;
	min-width: 110px;
	box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

#prev-btn:hover, #next-btn:hover {
	background: linear-gradient(180deg, #60a5fa, #3b82f6);
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(37, 99, 235, 0.45);
}

#prev-btn:active, #next-btn:active {
	background: linear-gradient(180deg, #3b82f6, #2563eb);
	transform: translateY(0);
	box-shadow: 0 6px 12px rgba(37, 99, 235, 0.35);
}

.episode-frame-container {
	/* Inline group that can wrap on small screens */
	display: flex;
	gap: 10px;
	align-items: center;
	position: relative;
	flex-wrap: wrap;
}

select {
	/* Acrylic select aligned with mobile style */
	padding: 10px 12px;
	font-size: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.9);
	color: #333;
	cursor: pointer;
	height: 44px;
	min-width: 140px;
	transition: all 0.2s ease;
}

#frame-input {
	/* Numeric input for frame index */
	font-size: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 8px;
	background-color: rgba(255, 255, 255, 0.9);
	color: #333;
	height: 44px;
	width: 120px;
	text-align: center;
	padding: 0 12px;
	transition: all 0.2s ease;
}

#frame-input::-webkit-inner-spin-button,
#frame-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

select:hover, #frame-input:hover {
	background-color: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

select:focus, #frame-input:focus {
	outline: none;
	border-color: #007bff;
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

@media (max-width: 1024px) {
	.container {
		padding: 16px;
		margin: 14px;
	}
}

@media (max-width: 768px) {
	.container {
		padding: 10px;
		margin: 10px;
	}

	.controls {
		gap: 8px;
	}

	.btn {
		padding: 9px 14px;
		font-size: 14px;
		min-width: 84px;
	}

	select, #frame-input, #timestamp-btn {
		height: 40px;
		font-size: 14px;
		min-width: 120px;
	}

	#prev-btn, #next-btn {
		min-width: 100px;
	}
}

.page-wrapper {
	/* Optional sidebar container used elsewhere */
	display: flex;
	gap: 20px;
	padding: 20px;
	max-width: 1920px;
	margin: 0 auto;
	align-items: flex-start;
}

.instructions-box {
	/* Acrylic instructional panel */
	background-color: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	padding: 20px;
	width: 250px;
	flex-shrink: 0;
}

.instructions-box h2 {
	color: #fff;
	margin-top: 0;
	margin-bottom: 15px;
	font-size: 1.2em;
}

.instructions-box ul {
	color: #e5e7eb;
	padding-left: 20px;
	margin: 0;
}

.instructions-box li {
	margin-bottom: 10px;
	line-height: 1.4;
}

.instructions-box li:last-child {
	margin-bottom: 0;
}

@media (max-width: 1024px) {
	.page-wrapper {
		flex-direction: column;
		align-items: center;
	}

	.instructions-box {
		width: 100%;
		max-width: 1300px;
		margin-bottom: 20px;
	}
}

@media (max-width: 768px) {
	.page-wrapper {
		padding: 10px;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 8px;
		margin: 8px;
		max-width: 100vw;
		text-align: center;
	}

	.page-wrapper {
		gap: 8px;
		padding: 8px;
		text-align: center;
	}

	.controls, .episode-frame-container {
		flex-direction: column;
		gap: 6px;
		width: 100%;
		align-items: stretch;
		text-align: center;
	}

	.btn, select {
		min-width: 60px;
		padding: 8px 10px;
		text-align: center;
	}

	#frame-input {
		width: 100%;
		box-sizing: border-box;
		text-align: center;
	}

	#prev-btn, #next-btn {
		min-width: 80px;
		text-align: center;
	}

	.instructions-box {
		padding: 12px;
		width: 100%;
		font-size: 13px;
		text-align: center;
		box-sizing: border-box;
	}

	.instructions-box h2 {
		font-size: 1em;
		text-align: center;
	}
}