:root {
  --font-color: rgba(0, 0, 0, 0.9);
  --bg-color: #fff;
  --primary-color: rgba(0, 0, 0, 1);
  --secondary-color: rgba(0, 0, 0, 0.5);
  --light-bg-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --font-color: rgba(255, 255, 255, 1);
  --bg-color: #090b28;
  --primary-color: rgba(255, 255, 255, 1);
  --secondary-color: rgba(255, 255, 255, 0.5);
  --light-bg-color: rgba(255, 255, 255, 0.1);
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
}
* {
  box-sizing: border-box;
  outline: 0;
  border: 0;
  font-family: Montserrat, "Roboto", "Noto", sans-serif;
}

::-webkit-scrollbar {
  width: 3px;
  height: 3px;
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--light-bg-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

::placeholder {
  color: var(--secondary-color);
  text-overflow: ellipsis;
  transition: all 0.2s;
}

::selection {
  background: var(--primary-color);
  color: var(--bg-color);
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes zoomin {
  from {
    opacity: 0;
    transform: translate(0, -64px) scale(0);
  }

  to {
    opacity: 1;
    transform: translate(0, -64px) scale(1);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--font-color);
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease-in-out;
  overflow-x: hidden;
  animation: fadein 0.2s;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a.link:hover,
.book-authors:hover,
.info:hover {
  color: var(--primary-color);
  transition: all 0.2s;
}
.container {
  display: flex;
  width: 100%;
  height: 100vh;
}

a[href^="https://www.google.com/?hl=en"]
{
  display: none !important;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

aside {
  position: fixed;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 32px;
  width: 20%;
  height: 100%;
  background-color: var(--bg-color);
  font-size: 14px;
  transition: all 0.2s;
}

.sidebar {
  background-color: #222;
  color: #fff;
  width: 250px;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: all 0.3s ease-in-out;
  z-index: 10;
}

.logo {
  padding: 0 32px;
  font-weight: 900;
  font-size: 24px;
  text-align: center;
  margin-bottom: 20px;
}
.logo a {
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 24px;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.subhead {
  padding: 32px;
  color: var(--secondary-color);
  font-weight: 600;
  transition: all 0.2s;
}

.nav {
  display: flex;
  margin: 8px 0;
  padding: 16px 32px;
  border-radius: 32px;
  background-color: var(--bg-color);
  font-weight: 600;
  transition: all 0.2s;
  align-items: center;
}
.navigation ul {
  list-style: none;
  padding: 0;
}

.nav-item {
  margin-bottom: 10px;
}
.nav .icon {
  margin-right: 16px;
}
.nav-link {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 6px;
  transition: background-color 0.3s ease-in-out;
  display: flex;
  align-items: center;
}

.nav-link.current {
  background-color: #4CAF50;
}

.nav-link:hover {
  background-color: #ddd;
}

.icon {
  margin-right: 10px;
  font-size: 18px;
}

.nav.current {
  background: var(--primary-color);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.4);
  color: var(--bg-color);
}

.nav:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.spacer {
  display: flex;
  flex-grow: 1;
}

.theme-switch {
  position: relative;
  display: flex;
  margin: 32px;
  width: 32px;
  height: 16px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch::before {
  padding-left: 48px;
  content: "🌗";
  cursor: pointer;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 8px;
  background-color: var(--light-bg-color);
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
}

.slider:hover:before {
  background: var(--light-bg-color);
}

.slider:active:before {
  background: var(--light-bg-color);
}

.slider:before {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: var(--secondary-color);
  content: "";
  transition: transform 0.3s ease-in-out;
}

input:checked + .slider {
  background-color: var(--light-bg-color);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

article {
  margin-left: 20%;
  width: 80%;
}

.results {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.fade {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  width: 32px;
  transition: all 0.2s;
}

.left {
  left: 0;
  background: linear-gradient(to right, var(--bg-color), transparent);
}

.right {
  right: 0;
  background: linear-gradient(to left, var(--bg-color), transparent);
}

.flex {
  display: flex;
  padding: 32px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}
/* Search Section Styles */
.search-bar {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}
.search-box {
  display: flex;
  padding: 16px 0;
  background-color: transparent;
  color: var(--font-color);
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s;
  flex-grow: 1;
}
#search-button {
  background-color: #4CAF50;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
}

#search-button:hover {
  background-color: #3e8e41;
}

.search-results {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.section-title {
  margin: 16px 0;
  font-weight: 900;
  font-size: 32px;
}
/* For You Section Styles */
.foryou-section .category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* Library Section Styles */
.library-section .library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  justify-content: center;
}
.pagination {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--light-bg-color);
  color: var(--font-color);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
}

.pagination:hover {
  background-color: var(--font-color);
  color: var(--bg-color);
}

.loader {
  display: flex;
  margin-bottom: 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--secondary-color);
  transition: all 0.2s;
  animation: fadein 1s infinite;
}

.prompt {
  display: flex;
  padding: 16px;
  color: var(--secondary-color);
  transition: all 0.2s;
}

.category {
  display: flex;
  margin: 16px;
  height: 25vh;
  border-radius: 16px;
  background-position: center center;
  background-size: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: #fff;
  transition: all 0.2s;
  align-items: center;
  flex: 1;
}

.category:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.category:nth-child(1) {
  background-color: #000000;
  background-image: url("icons/Bullseye-Gradient.svg");
}

.category:nth-child(2) {
  background-color: #ff66bb;
  background-image: url("icons/Cornered-Stairs.svg");
}

.category:nth-child(3) {
  background-color: #ff7700;
  background-image: url("icons/Flat-Mountains.svg");
}

.category:nth-child(4) {
  background-color: #ff0000;
  background-image: url("icons/Quantum-Gradient.svg");
}

.list-book {
  display: flex;
  padding: 32px 16px;
  width: 100%;
  flex-wrap: wrap;
}

.book {
  transition: transform 0.3s ease-in-out;
  display: flex;
  margin: 16px;
  padding: 32px;
  border-radius: 32px;
  flex: 1;
}


.categories {
  display: flex;
  overflow: auto;
  width: 100%;
  flex-wrap: nowrap;
}

.categories .book {
  width: 100%;
  white-space: nowrap;
}
.book:hover {
  transform: translateY(-5px);
}

.book-info {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.thumbnail {
  margin-right: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  transform: translate(0, -64px);
  animation: zoomin 0.5s;
}

.thumbnail:hover {
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
  transform: translate(0, -64px) scale(1.1);
}

.book-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  font-weight: 900;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.book-authors {
  display: -webkit-box;
  overflow: hidden;
  margin: 16px 0;
  color: var(--secondary-color);
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.info {
  display: inline-flex;
  padding: 8px 16px;
  border-radius: 32px;
  color: var(--secondary-color);
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.search,
.prev {
  display: none;
}

.trigger {
  cursor: pointer;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  visibility: hidden;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.2s;
  transform: scale(1.05);
}

.show-modal {
  visibility: visible;
  opacity: 1;
  transition: all 0.2s;
  transform: scale(1);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  overflow: auto;
  padding: 16px 32px;
  max-width: 50%;
  max-height: 80%;
  border-radius: 8px;
  background-color: var(--bg-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.fixed {
  position: fixed;
  top: 10%;
  left: 5%;
  width: 90%;
}

.close-button {
  position: fixed;
  top: 16px;
  right: 16px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--secondary-color);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  color: var(--font-color);
}

.book-details {
  display: flex;
}

.book-cover {
  margin-right: 16px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  aside {
    position: sticky;
    padding: 16px;
    width: 100%;
    height: auto;
  }

  article {
    margin: 0;
    width: 100%;
  }
}
/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  padding-top: 60px;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: #000;
}

/* Book Details Styles */
.book-details {
  display: flex;
  align-items: center;
}

.book-cover {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 20px;
}
/* No Results Found */
.no-results {
  text-align: center;
  font-size: 18px;
  color: #888;
  margin-top: 20px;
}

/* Error Message */
.error {
  text-align: center;
  font-size: 16px;
  color: red;
  margin-top: 20px;
}
