@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Oswald:wght@200..700&display=swap');

.alert {
	position: fixed;
	bottom: 30px;
	width: fit-content;
	min-width: 180px;
	right: 20px;
  font-size: 15px;
	padding: 5px 40px;
	background-color: #ddd;
	color: #000a;
	z-index: 99;
	box-shadow: 0 0 4px 1px #0003;
	border: 1px solid #0005;
	animation: shade .4s linear 1 normal forwards;
	border-radius: 20px;
}

.font-oswald {
	font-family: "Oswald", sans-serif;
}

.active {
	visibility: visible !important;
	transition: 0 !important;
}

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

body {
	font-size: 16px;
	font-family: "Oswald";
}

#new-book-container {
	visibility: hidden;
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background-color: #0006;
	z-index: 9;
}

#new-book {
	margin: 20px auto;
	width: 95%;
	max-width: 400px;
	background-color: #ddd;
	padding: 10px 20px;
	border-radius: 5px;
}

#new-book-title {
	text-align: center;
	font-size: 1.15rem;
}

#new-book-btns {
	padding: 10px;
	display: flex;
	gap: 15px;
}

#new-book-btns button {
	height: 40px;
	padding: 10px 5%;
	border-radius: 5px;
	background-color: #222;
	color: #ddd;
}

#search-isbn-container {
	display: flex;
	gap: 10px;
	margin: 0 auto;
	padding: 10px 0;
	width: fit-content;
}

#search-isbn-container input.empty {
	transition: .3s border-color;
	border-width: 1px;
	border-color: #a22a;
}

#search-isbn-container button {
	height: 30px;
	padding: 10px 10px;
	border-width: 1px;
	gap: 10px;
}

#add-isbn i {
	visibility: hidden;
	color: inherit;
}

#add-isbn.loading i {
	visibility: visible;
}


input {
	border-radius: 20px;
	outline: none;
	border: 1px solid #8889;
	padding: 10px;
	height: 30px;
	background-color: #eee;
	transition: .2s linear border-color;
}

input:focus, #search-isbn-container input.empty:focus {
	border-width: 1px;
	border-color: #000;
}

input:focus ~ i {
  color: #000 !important
}

button {
	--color-hover: #ddd;
	--background-color-hover: #000;
	outline: none;
	color: #0c4d79;
	border: 1px solid #0004;
	background-color: #adf;

	display: flex;
	justify-content: center;
	align-items: center;
	align-content: center;

	border-radius: 20px;
	padding: 5px;
	cursor: pointer;
}

button:hover {
	background-color: var(--background-color-hover);
	color: var(--color-hover);
	transition: .2s linear color, .2s linear background-color;
}


nav {
	max-width: 400px;
	width: 95%;
	height: 50px; 

	margin: 20px auto;
	border-radius: 25px;

	display: flex;
	align-content: center;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	color: #000;

	padding: 5px;

	border: 1px solid #0004;
	background-color: #ddd;
}

nav label {
	position: relative;
	flex-grow: 1;
	height: 100%;
}

nav label i {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
}

nav input {
	width: 100%;
	height: 100%;
}

#new-book-btn {
	border-radius: 50%;
	aspect-ratio: 1 / 1;
	height: 100%;
}

#new-book-btn i {
	color: inherit;
}



#shelf {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 150px));
	grid-auto-rows: 225px;
	gap: 40px 20px;
	justify-content: space-between;
	padding: 20px 5% 80px;
}

.book-view {
	position: relative;
	object-fit: cover;
	filter: drop-shadow(0 0 3px #0005);
	opacity: 0;
	animation: shade .4s linear 1 forwards;

	--border-radius: 5px;
}

@keyframes shade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.book-view img {
	width: 100%;
	height: 100%;
	border-radius: var(--border-radius);
}

.book-view .book-info {
	display: grid;
	visibility: hidden;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	grid-template-rows: 1fr auto;
	gap: 10px;
	padding: 5px;
	background-color: #0005;
	opacity: 0;
	border-radius: var(--border-radius);
}

.book-author {
	font-family: "Caveat", cursive;
	font-size: 1.4rem;
	color: #f5b868;
}

.book-title {
	font-size: 1.2rem;
	color: #fff;
}

.book-title, .book-author {
	overflow: hidden;
}

.book-view:hover > .book-info {
	visibility: visible;
	opacity: 1;
	transition: .2s linear;
}

.book-info > .close {
	position: absolute;
	top: 0;
	right: 0;
	transform: translate(50%, -50%);
	
	font-size: 20px;
	
	color: #d22;
	background-color: #000;
	border: none;

	border-radius: 50%;
	opacity: .5;
	transition: .3s linear;
	cursor: pointer;
	width: fit-content;
}

.book-info > .close:hover {
	opacity: 1;
}

#shelf:empty {
  display: block;
}

#shelf:empty::before {
  position: relative;
  content: "No books found";
  color: #777;
  font-family: Roboto, sans-serif;
  display: block;
  text-align: center;
}
