/* CSS Variables for Theme Management */
:root {
	/* Light theme colors */
	--bg-color: #ffffff;
	--text-color: #232323;
	--text-secondary: rgba(0, 0, 0, 0.671);
	--text-tertiary: rgba(0, 0, 0, 0.718);
	--search-bar-shadow: 0 0 18px rgba(70, 70, 40, 0.255);
	--search-bar-bg: rgba(255, 255, 255, 0.100);
	--submit-text-color: rgba(0, 0, 0, 0.718);
}

/* Dark theme colors */
@media (prefers-color-scheme: dark) {
	:root {
		--bg-color: #393939;
		--text-color: rgba(255, 255, 255, 0.369);
		--text-secondary: rgba(255, 255, 255, 0.369);
		--text-tertiary: rgba(255, 255, 255, 0.655);
		--search-bar-shadow: 1px 1px 7px rgba(255, 255, 255, 0.1);
		--search-bar-bg: rgba(255, 255, 255, 0.100);
		--submit-text-color: rgba(255, 255, 255, 0.655);
	}
}

/* Manual theme override */
[data-theme="light"] {
	--bg-color: #ffffff;
	--text-color: #232323;
	--text-secondary: rgba(0, 0, 0, 0.671);
	--text-tertiary: rgba(0, 0, 0, 0.718);
	--search-bar-shadow: 0 0 18px rgba(70, 70, 40, 0.255);
	--search-bar-bg: rgba(255, 255, 255, 0.100);
	--submit-text-color: rgba(0, 0, 0, 0.718);
}

[data-theme="dark"] {
	--bg-color: #393939;
	--text-color: rgba(255, 255, 255, 0.369);
	--text-secondary: rgba(255, 255, 255, 0.369);
	--text-tertiary: rgba(255, 255, 255, 0.655);
	--search-bar-shadow: 1px 1px 7px rgba(255, 255, 255, 0.1);
	--search-bar-bg: rgba(255, 255, 255, 0.100);
	--submit-text-color: rgba(255, 255, 255, 0.655);
}

/* Theme Toggle Button */
.theme-toggle {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	border: none;
	border-radius: 50%;
	background: var(--search-bar-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: var(--search-bar-shadow);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	transition: all 0.3s ease;
	z-index: 1000;
}

.theme-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 0 20px rgba(100, 149, 237, 0.3);
}

.theme-toggle:active {
	transform: scale(0.95);
}

.theme-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Light theme: show sun icon */
:root .light-icon {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0deg);
}

:root .dark-icon {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(180deg);
}

/* Dark theme: show moon icon */
[data-theme="dark"] .light-icon,
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .light-icon {
		opacity: 0;
		transform: translate(-50%, -50%) rotate(-180deg);
	}

	:root:not([data-theme="light"]) .dark-icon {
		opacity: 1;
		transform: translate(-50%, -50%) rotate(0deg);
	}
}

[data-theme="dark"] .dark-icon {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0deg);
}

[data-theme="dark"] .light-icon {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(-180deg);
}

/* Base Styles */
body {
	background-color: var(--bg-color);
	text-align: center;
	padding-bottom: 50px;
	margin: 0;
	transition: background-color 0.3s ease;
}

/* Loader Animation */
.loader {
	width: 80px;
	height: 80px;
	position: relative;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: #4bc0c8;
	animation: spin 2s linear infinite;
	display: flex;
	justify-content: center;
	align-items: center;
}

.all {
	height: 30vh;
	display: flex;
	justify-content: center;
	align-items: flex-end;
}

.loader::before {
	content: "";
	position: absolute;
	left: 5px;
	top: 5px;
	right: 5px;
	bottom: 5px;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: #c779d0;
	animation: spin 3s linear infinite;
}

.loader::after {
	content: "";
	position: absolute;
	left: 15px;
	top: 15px;
	right: 15px;
	bottom: 15px;
	border-radius: 50%;
	border: 4px solid transparent;
	border-top-color: #feac5e;
	animation: spin 1.5s linear infinite;
}

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

/* Content Styles */
#content {
	width: 100%;
	text-align: center;
	padding-bottom: 15px;
}

/* Search Styles */
.search_part {
	margin-bottom: 30px;
	margin-top: 20px;
}

.search_bar {
	box-shadow: var(--search-bar-shadow);
	-webkit-animation: fadeIn 2.5s;
	animation: fadeIn 2.5s;
	background-color: var(--search-bar-bg);
	border-radius: 50px;
	display: table;
	vertical-align: middle;
	width: 80%;
	height: 40px;
	max-width: 400px;
	margin: 10px auto;
	transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

span {
	display: block;
	overflow: hidden;
	padding-left: 5px;
}

#search_input {
	width: 90%;
	height: 40px;
	background-color: transparent;
	border: none;
	outline: 0;
	font-size: 16px;
	color: var(--text-secondary);
	padding: 0 20px;
	border-radius: 50px;
	transition: color 0.3s ease;
}

#search_input::placeholder {
	color: var(--text-secondary);
	opacity: 0.7;
}

#search_submit {
	outline: 0;
	height: 40px;
	width: 60px;
	float: right;
	color: var(--submit-text-color);
	font-size: 16px;
	font-weight: 700;
	border: none;
	background-color: rgba(135, 206, 235, 0.5);
	padding: 0 13px 0 13px;
	border-radius: 0 50px 50px 0;
	box-shadow: 1px 1px 5px rgba(100, 149, 237, 0.5);
	cursor: pointer;
	transition: background-color 0.3s ease, color 0.3s ease;
}

#search_submit:hover {
	background-color: rgba(0, 191, 255, 0.5);
}

/* Navigation Box Styles */
.box {
	-webkit-animation: fadeInDown 1s;
	animation: fadeInDown 1s;
	position: relative;
	display: inline-block;
	width: 75px;
	border: 0;
	margin: 0 5px;
}

.box a {
	width: 100%;
	height: 100%;
	position: absolute;
	left: 0;
	top: 0;
}

.url {
	color: var(--text-color);
	height: 1.5em;
	line-height: 1.5em;
	width: 72px;
	font-size: 0.75em;
	white-space: nowrap;
	overflow: hidden;
	margin: auto;
	-webkit-border-top-right-radius: 5px;
	-webkit-border-bottom-right-radius: 5px;
	text-overflow: ellipsis;
	-o-text-overflow: ellipsis;
	-ms-text-overflow: ellipsis;
	padding-top: 3px;
	padding-bottom: 8px;
	transition: color 0.3s ease;
	pointer-events: none;
}

.icon {
	width: 3em;
	height: 3em;
	max-width: 72px;
	border-radius: 8px;
	transition: transform 0.2s ease;
	pointer-events: none;
}

.box:hover .icon {
	transform: scale(1.1);
}

/* Legacy styles for unused elements */
img.smaller {
	width: auto;
	height: auto;
	max-width: 210px;
	animation: flipInX 4s;
	-webkit-animation: flipInX 4s;
}

.logo {
	font-size: 2em;
	white-space: normal;
	word-wrap: break-word;
	text-decoration: none;
	color: var(--text-color);
	transition: color 0.3s ease;
}

/* Animations */
@-webkit-keyframes flipInX {
	0% {
		-webkit-transform: perspective(400px) rotateX(90deg);
		transform: perspective(400px) rotateX(90deg);
		opacity: 0;
	}
	40% {
		-webkit-transform: perspective(400px) rotateX(-10deg);
		transform: perspective(400px) rotateX(-10deg);
	}
	70% {
		-webkit-transform: perspective(400px) rotateX(10deg);
		transform: perspective(400px) rotateX(10deg);
	}
	100% {
		-webkit-transform: perspective(400px) rotateX(0);
		transform: perspective(400px) rotateX(0);
		opacity: 1;
	}
}

@keyframes flipInX {
	0% {
		-webkit-transform: perspective(400px) rotateX(90deg);
		-ms-transform: perspective(400px) rotateX(90deg);
		transform: perspective(400px) rotateX(90deg);
		opacity: 0;
	}
	40% {
		-webkit-transform: perspective(400px) rotateX(-10deg);
		-ms-transform: perspective(400px) rotateX(-10deg);
		transform: perspective(400px) rotateX(-10deg);
	}
	70% {
		-webkit-transform: perspective(400px) rotateX(10deg);
		-ms-transform: perspective(400px) rotateX(10deg);
		transform: perspective(400px) rotateX(10deg);
	}
	100% {
		-webkit-transform: perspective(400px) rotateX(0);
		-ms-transform: perspective(400px) rotateX(0);
		transform: perspective(400px) rotateX(0);
		opacity: 1;
	}
}

@-webkit-keyframes fadeIn {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@keyframes fadeIn {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

@-webkit-keyframes fadeInDown {
	0% {
		opacity: 0;
		-webkit-transform: translateY(-20px);
		transform: translateY(-20px);
	}
	100% {
		opacity: 1;
		-webkit-transform: translateY(0);
		transform: translateY(0);
	}
}

@keyframes fadeInDown {
	0% {
		opacity: 0;
		-webkit-transform: translateY(-20px);
		-ms-transform: translateY(-20px);
		transform: translateY(-20px);
	}
	100% {
		opacity: 1;
		-webkit-transform: translateY(0);
		-ms-transform: translateY(0);
		transform: translateY(0);
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	.search_bar {
		width: 90%;
	}

	.box {
		margin: 5px;
	}
}

@media (max-width: 480px) {
	#search_input {
		font-size: 14px;
	}

	.box {
		width: 65px;
	}

	.icon {
		width: 2.5em;
		height: 2.5em;
	}
}