/* Font fallback that closely matches Inter metrics */
@font-face {
	font-family: "Inter Fallback";
	size-adjust: 107%;
	ascent-override: 90%;
	src: local("Arial");
}

:root {
	font-family:
		Inter,
		"Inter Fallback",
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		Roboto,
		Oxygen,
		Ubuntu,
		Cantarell,
		"Open Sans",
		"Helvetica Neue",
		sans-serif;
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;

	/* Light mode colors */
	--text-color: #1a1a1a;
	--text-color-secondary: #666;
	--text-color-hover: #333;
	--bg-color: #fff;
	--bg-color-secondary: #f5f5f5;
	--bg-color-hover: #f0f0f0;
	--bg-color-active: #e5e5e5;
	--bg-color-danger: #e9808a;
	--border-color: #ddd;
}

@media (prefers-color-scheme: dark) {
	:root {
		--text-color: #e0e0e0;
		--text-color-secondary: #999;
		--text-color-hover: #fff;
		--bg-color: #121212;
		--bg-color-secondary: #1e1e1e;
		--bg-color-hover: #2a2a2a;
		--bg-color-active: #333;
		--bg-color-danger: #f15f6d;
		--border-color: #444;
	}
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	outline: none;
}
*:focus {
	outline: 2px solid var(--text-color-secondary);
}

html,
body {
	height: 100%;
	width: 100%;
}

body {
	line-height: 1.5;
	font-weight: 400;
	font-size: 16px;
	color: var(--text-color);
	background-color: var(--bg-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 600;
	line-height: 1.2;
	padding-bottom: 0.75rem;
}

a {
	color: var(--text-color-secondary);
}
a:hover {
	color: var(--text-color-hover);
}
footer a {
	color: var(--text-color) !important;
}
footer a:hover {
	color: var(--text-color-hover) !important;
}

button {
	font: inherit;
	border: none;
	background: none;
	cursor: pointer;
}

input,
textarea {
	font: inherit;
}

/* Add these new styles */
.url-container {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
}

.content-container {
	max-width: 37rem;
	text-align: center;
	padding: 0 8px;
	text-wrap: pretty;
}

input {
	margin: 2px 0px !important;
	padding: 8px 12px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	width: 100%;
	background: var(--bg-color-secondary);
	color: var(--text-color);
}

.flash-white {
	outline: 2px solid var(--text-color-secondary);
	background: color-mix(in srgb, var(--text-color) 75%, var(--bg-color));
	opacity: 0.2;
	animation: flash 0.275s forwards;
}

@keyframes flash {
	0% {
		opacity: 0.2;
		outline: 2px solid var(--text-color-secondary);
		background: color-mix(in srgb, var(--text-color) 55%, var(--bg-color));
	}
	50% {
		opacity: 1;
		outline: 2px solid var(--text-color-hover);
		background: color-mix(in srgb, var(--text-color) 75%, var(--bg-color));
	}
	100% {
		opacity: 0.2;
		outline: 2px solid var(--text-color-secondary);
		background: color-mix(in srgb, var(--text-color) 55%, var(--bg-color));
	}
}

.copy-button {
	padding: 8px;
	color: var(--text-color-secondary);
	border-radius: 4px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.copy-button:hover {
	background: var(--bg-color-hover);
}

.copy-button:active {
	background: var(--bg-color-active);
}

.copy-button img {
	width: 20px;
	height: 20px;
}

.copy-button.copied {
	background: #28a745;
}

/* Add footer styles */
.footer {
	position: fixed;
	bottom: 16px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 14px;
	color: var(--text-color-secondary);
}

.footer a {
	color: var(--text-color-secondary);
	text-decoration: none;
	font-weight: 500;
}

.footer a:hover {
	color: var(--text-color-hover);
}

.settings-button {
	padding: 8px;
	color: var(--text-color-secondary);
	border-radius: 4px;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.settings-button:hover {
	background: var(--bg-color-hover);
}

.settings-button:hover {
	background: var(--bg-color-active);
}

.settings-button:hover img,
.settings-button.rotate img {
	transform: rotate(180deg);
	transition: transform 0.6s ease;
}

.settings-button:active {
	transform: scale(0.95);
}

.settings {
	transition: transform 0.6s ease;
}

.settings-button:not(:hover):not(.rotate) .settings {
	transform: rotate(0deg);
}

.modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1000;
}

.modal-content {
	position: relative;
	background-color: var(--bg-color);
	border: 1px solid var(--border-color);
	margin: 5% auto; /* Reduced from 15% to 5% to give more space */
	padding: 20px;
	border-radius: 8px;
	width: 80%;
	max-width: 500px;
	max-height: 80vh; /* 80% of viewport height */
	overflow-y: auto; /* Makes content scrollable */
}

.close-modal {
	position: absolute;
	right: 10px;
	top: 10px;
	cursor: pointer;
	font-size: 24px;
	color: var(--text-color-secondary);
	padding-left: 8px;
	padding-right: 8px;
}

.bang-select {
	width: 100%;
	padding: 8px;
	margin-top: 10px;
	border-radius: 4px;
	padding-right: 30px;
}

.bang-select-container {
	position: relative;
	display: inline-block;
	width: 100%;
}

.bang-select-container::after {
	content: "↵";
	position: absolute;
	right: 10px;
	top: 18%;
	color: var(--text-color-secondary);
	pointer-events: none;
	font-size: 1.2em;
}

@keyframes shake {
	0%,
	100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-5px);
	}
	75% {
		transform: translateX(5px);
	}
}

@keyframes flash-red {
	0%,
	100% {
		background-color: transparent;
	}
	50% {
		background-color: rgba(255, 0, 0, 0.2);
	}
}

.shake {
	animation: shake 0.2s ease-in-out;
}

.flash-red {
	animation: flash-red 0.3s ease-in-out;
}

.settings-section {
	margin-bottom: 1rem;
}

.switch {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0;
}

.switch input {
	width: 40px;
	height: 20px;
	appearance: none;
	background-color: var(--bg-color-secondary);
	border-radius: 20px;
	position: relative;
	cursor: pointer;
	transition: background-color 0.3s;
}

.switch input:checked {
	background-color: var(--text-color);
}

.switch input:before {
	content: "";
	width: 16px;
	height: 16px;
	background-color: var(--text-color);
	position: absolute;
	border-radius: 50%;
	top: 2px;
	left: 2px;
	transition:
		left 0.3s,
		background-color 0.3s;
}

.switch input:checked:before {
	background-color: var(--bg-color-secondary);
	left: 22px;
}

.clear-history,
.remove-bang {
	margin-top: 8px;
	padding: 8px 16px;
	background-color: var(--bg-color-danger);
	color: var(--text-color);
	border-radius: 4px;
	transition: all 0.2s;
}

.remove-bang {
	padding: 4px 6px;
}

.clear-history:hover,
.remove-bang:hover {
	background-color: var(--bg-color-hover);
}

.clear-history:active,
.remove-bang:active {
	background-color: var(--bg-color-active);
	transform: scale(0.98);
}

.add-bang {
	margin-top: 8px;
	padding: 8px 16px;
	background-color: var(--text-color);
	color: var(--bg-color);
	border-radius: 4px;
	transition: all 0.2s;
}

.add-bang:hover {
	background-color: var(--bg-color-hover);
	color: var(--text-color-hover);
}

.add-bang:active {
	background-color: var(--bg-color-active);
	transform: scale(0.98);
}

.custom-bang-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	margin-top: 8px;
}

.custom-bang-info {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--border-color);
}

.custom-bang-info td {
	color: var(--text-color-secondary);
	padding: 8px 16px;
	border: 1px solid var(--border-color);
}

.custom-bang-info td:nth-child(2) code {
	padding: 0.3rem;
	border-radius: 4px;
	word-break: break-all;
	background-color: var(--bg-color-secondary);
}

.custom-bang-info td:last-child {
	border-right: 1px solid var(--border-color);
}

.custom-bang-name {
	font-weight: 500;
}

.custom-bang-url {
	word-break: break-all;
	color: var(--text-color-secondary);
}
