@import url("https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");

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

.img {
	display: block;
	width: 100%;
	object-fit: cover;
}

html,
body {
	margin: 0;
	padding: 0;
	font-size: 1rem;
	font-family: "Ubuntu", sans-serif;
	scroll-behavior: smooth;
	position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
	margin: 0;
	padding: 0;
}

ul {
	list-style-type: none;
}

a {
	text-decoration: none;
}

main {
	margin-top: 6rem;
}

.nav {
	height: 4.375rem;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background-color: white;
	display: flex;
	align-items: center;
	box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}

.logo {
	height: 2.5rem;
	width: 2.5rem;
	background-color: black;
	display: grid;
	place-items: center;
	border-radius: 100%;
	margin-left: 1rem;
}

/*  */
.nav-container {
	display: flex;
	align-items: center;
	width: 100%;
	justify-content: space-between;
	margin: 0 auto;
	padding: 0 1rem;
}

nav {
	z-index: 20;
}

.test {
	display: flex;
}
.nav-buttons {
	display: flex;
}

.close-search {
	display: none;
}

.show-search .hamburger {
	display: none;
}

.show-search .close-search {
	display: grid;
}

.hamburger,
.close-search {
	height: 4.375rem;
	width: 4.375rem;
	place-items: center;
}

.book-logo {
	display: flex;
	align-items: center;
	column-gap: 1rem;
	padding: 0;
	margin-left: 0;
}

.show-search .book-logo {
	display: none;
}

.book-comp {
	display: none;
}

.nav-search-bar {
	display: flex;
	margin-left: 2rem;
	border: none;
	/* gap: 1.5rem; */
	flex-grow: 1;
	max-width: 25rem;
	position: relative;
}

.nav-search-bar input {
	padding: 0.5rem 0.8rem;
	flex-grow: 1;
	max-width: 25rem;
	border: none;
	display: none;
	padding-block: 0.8rem;
	outline: none;
}

.search-books-btn {
	display: none;
	padding: 0.3rem 0.5rem;
	border: none;
}

.search-icon-only {
	background: none;
	border: none;
	margin-left: 4rem;
}

.show-search .nav-search-bar {
	width: 16.81rem;
	border: 1px solid #ddd;
}

.show-search input {
	display: block;
}

.show-search .search-books-btn {
	display: block;
}

.show-search .search-icon-only {
	display: none;
}

.nav-info {
	display: flex;
	align-items: center;
	gap: 1rem;
	/* padding-right: 1rem; */
	/* margin-left: auto; */
}

.show-search .nav-info {
	display: none;
}

.notification {
	position: relative;
}

.notification-number {
	position: absolute;
	top: -0.4375rem;
	right: -0.4375rem;
	height: 1.25rem;
	width: 1.25rem;
	background: #65c100;
	color: #fff;
	font-size: 0.75rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
}

.back-arrow,
.hamburger,
.open-search {
	background: none;
	border: none;
	cursor: pointer;
}

/* ******************************
****SIDEBAR 
**********************************/
/* Sidebar */
/* other positions asides absolute doesnt make the sidebar scrollable */
.sidebar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	position: fixed;
	top: 0;
	left: 0;
	width: 18.75rem;
	z-index: 30;
	padding-bottom: 2rem;
	background-color: white;
	transform: translateX(-100%);
	transition: all 0.5s ease-in-out;
	height: 100%;
	overflow-y: scroll;
}

.sidebar::-webkit-scrollbar {
	display: none;
}

.sidebar.show-sidebar {
	transform: translateX(0);
}

.sidebar-header {
	padding: 0 2rem;
}

.sidebar .logo {
	margin-left: 0;
}

.book-logo .sidebar-title {
	font-size: 1.125rem;
	font-weight: 400;
}

.book-logo .sidebar-user {
	font-size: 0.75rem;
}

.sidebar .back-arrow {
	margin-left: -1.5rem;
	margin-bottom: 2rem;
}

.sidebar-links {
	margin-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.sidebar-links ul {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0 2rem;
	text-transform: capitalize;
}

.sidebar-links-header {
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.sidebar-links ul:nth-child(odd) {
	border-bottom: 1px solid #eee;
	padding-bottom: 1rem;
}

.sidebar-links li {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.sidebar-link {
	cursor: pointer;
	transition: all 0.3s ease-in;
	font-size: 0.875rem;
	color: #000;
}

.sidebar-links li span {
	font-size: 0.75rem;
	color: #aaa;
}

.sidebar-link:hover {
	color: #65c100;
}

.sidebar-links .unread {
	width: 1.5rem;
	height: 1.25rem;
	display: block;
	background-color: #65c100;
	color: #eee;
	display: grid;
	border-radius: 50%;
	place-items: center;
}

.section {
	padding: 0 2rem;
	width: 100%;
	overflow-x: hidden;
	margin: 0 auto;
	margin-bottom: 2rem;
}

.header-title {
	text-transform: uppercase;
	letter-spacing: 3px;
	font-size: 0.875rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #eee;
	margin-bottom: 1rem;
}
.section-container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.book {
	display: flex;
	column-gap: 0.7rem;
	align-items: center;
	font-size: 0.75rem;
	cursor: pointer;
}

.book-details {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.book-status {
	margin-bottom: 1rem;
	font-size: 0.75rem;
	font-weight: 400;
	text-transform: capitalize;
}

.book-status.available {
	color: #65c100;
}
.book-status.borrowed-out {
	color: #d0011b;
}

.book-title {
	font-size: 0.875rem;
	margin-bottom: 3px;
}

.book-genre {
	margin-bottom: 5px;
}

.book-ratings {
	display: flex;
	column-gap: 0.5rem;
	align-items: center;
}

.book-ratings .rating {
	padding-right: 0.5rem;
	border-right: 1px solid #eee;
}

.book-ratings .rating p {
	margin-bottom: 0.25rem;
}

.section-container {
	display: grid;
	gap: 1.5rem;
}

@media screen and (min-width: 768px) {
	.section-container {
		grid-template-columns: 1fr 1fr;
	}
	.nav {
		height: 6.25rem;
	}
	.nav-container .hamburger,
	.nav-container .close-search {
		display: none;
	}

	.book-comp {
		display: block;
	}

	.book-comp h2 {
		font-size: 1rem;
		font-weight: 400;
	}
	.book-comp p {
		font-size: 0.625rem;
	}

	.nav-search-bar input,
	.search-books-btn {
		display: block;
	}

	.nav-search-bar {
		border: 1px solid #ddd;
		max-width: 20.68rem;
	}

	.nav-search-bar input {
		max-width: 30rem;
		margin-right: 1rem;
	}
	.search-icon-only {
		display: none;
	}
	.sidebar .book-logo,
	.back-arrow {
		display: none;
	}

	.sidebar-links {
		margin-top: 7rem;
	}

	.sidebar {
		position: fixed;
		z-index: 10;
		transform: translateX(0);
		box-shadow: 4px 0px 4px 0px rgba(0, 0, 0, 0.25);
		margin-top: 0;
	}

	main {
		transform: translateX(300px);
		z-index: -90;
		margin-top: 8rem;
	}

	.section {
		margin: 0;
		margin-bottom: 2rem;
	}
}

@media screen and (min-width: 980px) {
	.book-comp h2 {
		font-size: 1.125rem;
	}
	.book-comp p {
		font-size: 0.75rem;
	}

	.nav-search-bar {
		max-width: 30rem;
	}
	.sidebar .book-logo,
	.back-arrow {
		display: none;
	}

	.sidebar-links {
		margin-top: 7rem;
	}

	.sidebar {
		position: fixed;
		z-index: 10;
		transform: translateX(0);
		box-shadow: 4px 0px 4px 0px rgba(0, 0, 0, 0.25);
		margin-top: 0;
	}

	nav {
		z-index: 20;
	}

	main {
		margin-top: 8rem;
		width: 80% !important;
	}

	.section {
		margin: 0;
		margin-bottom: 2rem;
	}

	.section-container {
		grid-template-columns: repeat(3, 1fr);
		gap: 1rem;
	}
}

.carousel {
	margin-bottom: 3rem;
}

.carousel-cell {
	position: relative;
	width: 8.75rem;
	height: 13.125rem;
	margin-right: 0.625rem;
	border-radius: 5px;
	cursor: auto;
}

.carousel-cell img {
	width: 100%;
	display: block;
	object-fit: cover;
}

.dot.is-selected {
	background: #65c100;
}

@media screen and (min-width: 768px) {
	.carousel-cell {
		width: 13.75rem;
		height: 20.625rem;
	}
}

.carousel-show-details,
.close-overlay {
	background: none;
	border: none;
}
.carousel-show-details {
	position: absolute;
	top: 0.625rem;
	right: 0.625rem;
	cursor: pointer;
}

.carousel-book-underlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(rgba(0, 0, 0, 0.61), rgba(0, 0, 0, 1));
	color: #fff;
	padding: 1rem;
	display: none;
}

.show-carousel-book-underlay .carousel-book-underlay {
	display: block;
}

.carousel .carousel-book-underlay {
	font-size: 0.75rem;
}

.carousel-book-underlay .book-genre {
	display: none;
}

.c-stars {
	display: flex;
}

div .close-overlay {
	display: flex;
	cursor: pointer;
	font-size: 2rem;
	color: #eee;
	margin-left: auto;
}

.rating.c-rating {
	border: none;
}

.carousel .book-ratings {
	flex-direction: column;
	align-items: flex-start;
	margin-top: 5px;
}

.c-rating-likes {
	display: flex;
	gap: 0.625rem;
	align-items: center;
	margin-top: 0.625rem;
}

.featured-title {
	margin-left: 2rem;
}

@media screen and (min-width: 768px) {
	.carousel {
		margin-left: 2rem;
	}
	.carousel-show-details,
	.carousel-book-underlay .close-overlay {
		display: none;
	}

	.carousel-cell:hover .carousel-book-underlay {
		display: flex;
	}

	.carousel-book-underlay {
		flex-direction: column;
		gap: 1rem;
		padding: 2rem;
	}
	.carousel .carousel-book-underlay {
		font-size: 1rem;
	}

	.carousel-book-underlay {
		padding-top: 3rem;
	}

	.carousel-book-underlay .book-genre {
		display: block;
	}

	.flickity-slider {
		margin-left: -3rem;
	}

	.carousel .book-ratings {
		flex-direction: row;
		align-items: center;
	}

	.c-rating-likes {
		margin-top: 0;
	}

	.rating.c-rating {
		border-right: 1px solid #aaa;
	}
}

.searched-items {
	position: absolute;
	left: 0;
	top: 100%;
	padding: 1.5rem;
	width: 100%;
	background: #fff;
	box-shadow: 0 0.625rem 0.625rem rgba(0, 0, 0, 0.25);
	display: none;
	border-top: 1px solid rgba(0, 0, 0, 0.25);
}

.show-searched-items {
	display: block;
}

.searched-items ul {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	color: black;
}

.searched-items ul span {
	color: gray;
}
@media screen and (min-width: 768px) {
	.flickity-button {
		background-color: white;
		height: 100%;
		border-radius: 0;
		font-size: 1rem;
	}
}
