@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Oswald:wght@500&display=swap");
:root {
	--primary: #1a1a1a;
	--secondary: #fcf7f8;
	--paper: #f5f5f5;
}

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

body {
	font-family: "Inter", sans-serif;
	background: var(--paper);
	color: #111;
}

.container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.topBar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--primary);
	color: white;
	border-bottom: 1px solid rgba(0, 0, 0, 0.15);
	padding: 1rem 2rem;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.5rem;
}

.header-left h1 {
	font-family: "Oswald", sans-serif;
	font-weight: 500;
	font-size: 2rem;
	line-height: 1;
}

.subtitle {
	font-size: 0.75rem;
	opacity: 0.6;
}

.header-center {
	margin-left: auto;
	max-width: 420px;
	width: 100%;
}

.search {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid rgba(0, 0, 0, 0.3);
	border-radius: 25px;
	background: white;
}
.search:focus {
	outline: 2px solid wheat;
}

#add-manga-btn {
	font-family: sans-serif;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid var(--primary);
	background: var(--secondary);
	color: var(--primary);
	font-size: 2.1rem;
	cursor: pointer;
}

.content {
	padding: 2rem;
}

.library-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.5rem;
}

.card {
	position: relative;
	aspect-ratio: 2 / 3;
	background-size: cover;
	background-position: center;
	border: 2px solid black;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	overflow: hidden;
	transition: transform 0.25s ease, filter 0.25s ease;
	-webkit-touch-callout: none;
	user-select: none;
}

.card:hover {
	transform: translateY(-8px);
}

.card.read {
	filter: saturate(0) brightness(0.9);
}

.card .gradient {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 40%;
	background: linear-gradient(to top, rgba(20, 20, 20, 0.9), transparent);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 0.75rem;
	color: white;
}

.card h3 {
	font-size: 1rem;
	line-height: 1.2;
}

.card p {
	font-size: 0.8rem;
	opacity: 0.85;
}

.card .gradient * {
	transform: translateY(30px);
	transition: transform 0.3s ease;
}

.card:hover .gradient * {
	transform: translateY(0);
}

.card .buttons {
	margin-top: 5px;
	width: 100%;
	display: flex;
	justify-content: space-around;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.card:hover .buttons {
	opacity: 1;
	pointer-events: auto;
}

.card button {
	width: 80px;
	height: 30px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s;
}

.card button:last-child {
	background: var(--primary);
	color: var(--paper);
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 100;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
}

.modal-content {
	position: relative;
	max-width: 400px;
	margin: 10vh auto;
	background: var(--secondary);
	border: 2px solid black;
	border-radius: 6px;
	padding: 1.5rem;
}

.modal-content h2 {
	margin-bottom: 1rem;
}

.modal-content form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.modal-content label {
	display: flex;
	flex-direction: column;
	font-size: 0.9rem;
}

.modal-content input[type="text"],
.modal-content input[type="url"] {
	padding: 0.4rem;
	border: 1px solid black;
}

.checkbox {
	flex-direction: row;
	align-items: center;
	gap: 0.5rem;
}

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1rem;
}

.modal-actions button {
	padding: 0.4rem 0.8rem;
	border: 2px solid black;
	background: white;
	cursor: pointer;
	border-radius: 6px;
}

.hidden {
	display: none;
}

@media (max-width: 768px) {
	.header-left h1 {
		font-size: 1.5rem;
	}

	.library-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}
}
* {
	-webkit-tap-highlight-color: transparent;
}
