:root {
	--bg-primary: #0a0a0a;
	--text-primary: #eaeaea;
	--text-secondary: #a0a0a0;
	--accent: #e94560;
	--overlay-bg: rgb(0 0 0 / 70%);
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: var(--bg-primary);
	color: var(--text-primary);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#wallpaper-container {
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	background-color: var(--bg-primary);
}

.wallpaper-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
}

#wallpaper-container.cover .wallpaper-image {
	object-fit: cover;
}

.overlay {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--overlay-bg);
	border: 1px solid rgb(255 255 255 / 15%);
	border-bottom: none;
	border-radius: 12px 12px 0 0;
	padding: 24px 20px 6px;
	transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay.collapsed {
	padding: 24px 20px 6px;
}


.info-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	max-width: 95%;
	margin: 0 auto;
	font-size: 0.9rem;
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay:not(.collapsed) .info-bar {
	max-height: 200px;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.overlay:not(.collapsed) {
	padding: 24px 20px 12px;
}

#overlay-toggle {
	position: absolute;
	top: 6px;
	left: 50%;
	transform: translateX(-50%);
	background: transparent;
	border: none;
	color: var(--text-primary);
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.2s ease-out;
}

#overlay-toggle:hover {
	background-color: rgb(255 255 255 / 10%);
}

.overlay.hidden {
	opacity: 0;
	pointer-events: none;
}

.action-buttons {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nav-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-buttons button {
	padding: 6px 12px;
	font-size: 1.1rem;
	line-height: 1;
	border-radius: 6px;
}

.nav-buttons button:first-child {
	border-top-left-radius: 6px;
	border-bottom-left-radius: 6px;
}

.nav-buttons button:last-child {
	border-top-right-radius: 6px;
	border-bottom-right-radius: 6px;
}

.nav-buttons button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.info-bar button {
	background: none;
	border: none;
	color: var(--accent);
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-decoration: none;
}

.info-bar a:hover {
	text-decoration: underline;
}

.error-message {
	position: fixed;
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: rgb(233 69 96 / 90%);
	color: white;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 0.9rem;
	z-index: 100;
}

.error-message.hidden {
	display: none;
}

.loading-spinner {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	border: 3px solid rgb(255 255 255 / 20%);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 100;
}

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

.loading-spinner.hidden {
	display: none;
}

.toast-message {
	position: fixed;
	bottom: 70px;
	right: 20px;
	background: rgb(76 175 80 / 90%);
	color: white;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 0.85rem;
	z-index: 100;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.toast-message.shown {
	transform: translateY(0);
}

.toast-message.hidden {
	display: none;
}

.toast-message.error {
	background: rgb(255 152 0 / 90%);
}

.wallpaper-image.fading-out {
	animation: fade-out 1600ms ease forwards;
}

@keyframes fade-out {
	from {
		opacity: 1;
	}

	to {
		opacity: 0;
	}
}

.wallpaper-image.fading-in {
	animation: fade-in 1600ms ease forwards;
}

@keyframes fade-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

.wallpaper-image.active {
	opacity: 1;
}
