/* Base and Reset */
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f7f7f9;
  color: #32325d;
}

/* Header and Navigation */
header.main-header-flex {
  background: #22223b;
  min-height: 48px;
  box-shadow: 0 2px 10px 0 #1111160d;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
nav {
  width: 100%;
  display: flex;
  justify-content: center;
}
nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 6.5px 14px;
  border-radius: 5px;
  transition: background 0.16s, color 0.15s;
  cursor: pointer;
}
nav a:hover {
  background: #515087;
  color: #ffe971;
}

/* Banner with logo/title */
.library-banner {
  position: relative;
  width: 100vw;
  max-width: 100%;
}
.library-banner img {
  width: 100vw;
  max-width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 0 0 40px 40px;
  box-shadow: 0 6px 36px #17171018;
  display: block;
}
.banner-hero-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: none;
  padding: 0;
  box-shadow: none;
}
.banner-hero-title h1 {
  margin: 0;
  font-size: 2.7rem;
  color: #f6f8ff;
  letter-spacing: 2px;
  font-weight: 700;
  text-shadow: 0 2px 16px rgba(24,24,46,0.42), 0 0px 1.5px #28274d;
}
.banner-hero-title .banner-hero-subtitle {
  font-size: 1.22rem;
  color: #d6defc;
  font-weight: 400;
  letter-spacing: 0.16px;
  text-shadow: 0 1.5px 12px #181f30e8;
}
@media (max-width: 600px) {
  .library-banner img {
    height: 120px;
    border-radius: 0 0 20px 20px;
  }
  .banner-hero-title h1 {
    font-size: 1.3rem;
  }
  .banner-hero-title .banner-hero-subtitle {
    font-size: 0.82rem;
  }
}

/* Search Section */
.search-section {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0 30px 0;
}
.search-section input {
  width: 400px;
  padding: 15px 20px;
  border: none;
  border-radius: 5px 0 0 5px;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(25, 17, 48, 0.08);
  outline: none;
  background: #fff;
}
.search-section input[readonly] {
  cursor: pointer;
  background: #f0f0f0;
}
.search-section button {
  padding: 15px 20px;
  background: #9a8c98;
  color: #fff;
  border: none;
  border-radius: 0 5px 5px 0;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.25s;
}
.search-section button:hover {
  background: #6f6a79;
}

/* Search Modal */
#searchModal.modal-bg {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(38, 38, 69, 0.13);
  z-index: 10000;
}
.search-pop-box {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px 6px rgba(28, 32, 61, 0.12);
  padding: 34px 44px 33px 44px;
  min-width: 390px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: modal-fade-in 0.27s cubic-bezier(.34, 1.45, .65, .99);
}
.big-search-input {
  width: 310px;
  background: #f8fafc;
  border: 1.5px solid #e5e6ef;
  font-size: 1.15rem;
  font-family: inherit;
  padding: 13.5px 18px;
  margin: 0 0 22px 0;
  border-radius: 12px;
  outline: none;
  box-shadow: none;
  transition: border-color 0.18s;
}
.big-search-input:focus {
  border-color: #6e73ff;
  background: #f5f6fa;
}
.search-type-choices {
  display: flex;
  gap: 8px;
  font-size: 1.04rem;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.search-type-choices span {
  font-weight: 500;
  color: #22203a;
}
.st-choice {
  border-radius: 22px;
  font-size: 0.99rem;
  font-family: inherit;
  padding: 6.5px 17px;
  background: #f2f3fb;
  color: #373a6a;
  border: 1.2px solid #e4e4f1;
  margin: 0;
  cursor: pointer;
  transition: background 0.17s, color 0.17s, border 0.17s;
  outline: none;
}
.st-choice.selected,
.st-choice:hover {
  background: #4143d9;
  color: #fff;
  border-color: #4143d9;
}
#searchModal .close-btn {
  position: absolute;
  top: 17px;
  right: 19px;
  background: none;
  border: none;
  color: #aeb1c2;
  font-size: 2.2rem;
  cursor: pointer;
  font-weight: normal;
  transition: color 0.18s;
  z-index: 1;
}
#searchModal .close-btn:hover {
  color: #d42c31;
}

/* Topics Section */
.topics-section {
  text-align: center;
  margin-top: 60px;
  margin-bottom: 45px;
}
.topics-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  margin: 40px auto 0 auto;
  max-width: 900px;
}
.topic-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px 0 rgba(40, 36, 42, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 130px;
  padding: 18px 8px;
  transition:
    box-shadow 0.2s,
    transform 0.22s cubic-bezier(.21, 1.3, .51, 1.03),
    background 0.18s;
  cursor: pointer;
  margin-bottom: 15px;
}
.topic-card:hover {
  transform: translateY(-7px) scale(1.055);
  box-shadow: 0 12px 32px 0 rgba(40, 36, 42, 0.15);
}
.icon {
  font-size: 2.1rem;
  margin-bottom: 10px;
}
.topic-title {
  font-size: 1.05rem;
  color: #32325d;
}
.see-more-card {
  background: #dbeafe;
  border: 2px dashed #a7f3d0;
  color: #0e7490;
}
.see-more-card:hover {
  background: #0ea5e9;
  color: #fff;
  border: 2px solid #0ea5e9;
}

/* Modal Common */
.modal-bg {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(41, 45, 66, 0.18);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.modal, .modal-large, .modal-menu, .modal-bookinfo {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(50, 40, 60, 0.21);
  position: relative;
  animation: modal-fade-in 0.33s cubic-bezier(.43, .84, .41, .99);
  max-height: 90vh;
  overflow-y: auto;
}
.modal {
  width: 420px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-large {
  width: 650px;
  padding: 30px 20px 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-menu {
  width: 430px;
  padding: 32px 38px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 120px;
  box-sizing: border-box;
}
.modal-bookinfo {
  width: 700px;
  max-width: 94vw;
  min-height: 280px;
  padding: 32px 50px 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-sizing: border-box;
}
@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.close-btn {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #919191;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #dc2626;
}

/* Topics Modal */
.topics-grid-modal {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 36px;
  width: 94%;
}
.topic-card-modal {
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  font-size: 1.05rem;
  gap: 18px;
  cursor: pointer;
  transition: background 0.16s, transform 0.2s;
}
.topic-card-modal:hover {
  background: #fee2e2;
  transform: translateY(-4px) scale(1.03);
}

/* Book Collections */
.books-collections {
  margin: 30px auto 50px auto;
  max-width: 1200px;
  padding: 0 20px;
}
.books-collections h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #29314a;
  margin-bottom: 22px;
}
.books-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 18px;
  justify-content: flex-start;
}

/* Book Card */
.book-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(44, 40, 80, 0.09);
  width: 170px;
  max-width: 100%;
  cursor: pointer;
  padding: 16px 7px 12px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.18s, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.book-card:hover {
  box-shadow: 0 10px 30px rgba(36, 36, 48, 0.25);
  transform: translateY(-5px) scale(1.03);
}
.book-card img {
  width: 95px;
  height: 125px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
  background: #eef2f9;
}
.book-card-title {
  font-size: 1.07rem;
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
  color: #181843;
}
.book-card-meta {
  font-size: 0.93rem;
  color: #476685;
  margin-bottom: 10px;
  text-align: center;
}
.book-card-avail {
  font-size: 0.94rem;
  color: #fff;
  background: #14b8a6;
  border-radius: 14px;
  padding: 2.5px 12px;
  margin-top: 5px;
  font-weight: 500;
  user-select: none;
}
.book-card-avail.unavail {
  background: #ef4444;
}
.book-card-desc {
  font-size: 0.93rem;
  color: #63687c;
  text-align: center;
  height: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Buy Button */
.book-buy-btn {
  display: inline-block;
  margin-top: 7px;
  padding: 6px 17px;
  background: linear-gradient(90deg, #3253ec 60%, #1ecab8 100%);
  color: #fff;
  border-radius: 18px;
  font-size: 0.99rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 6px #1951ed13;
}
.book-buy-btn:hover {
  background: linear-gradient(90deg, #2230c6 40%, #17997e 100%);
  box-shadow: 0 3px 12px #1ecab82c;
}

/* Book Modal */
.book-modal-content {
  display: flex;
  align-items: flex-start;
  gap: 38px;
}
.book-modal-img {
  width: 170px;
  height: 225px;
  object-fit: contain;
  background: #f4f7fa;
  border-radius: 7px;
  box-shadow: 0 3px 12px #aaa2;
  margin-top: 7px;
}
.book-modal-details {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 470px;
}
.book-modal-details h3 {
  font-size: 1.35rem;
  color: #181843;
  margin-bottom: 10px;
}
.modal-book-meta {
  color: #475569;
  font-size: 1.1rem;
  margin-bottom: 9px;
}
.modal-book-moreinfo {
  margin-top: 15px;
  font-size: 1rem;
  color: #34465d;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
}

/* Footer */
.footer-oasis {
  background: #f5f7fc;
  color: #19213a;
  text-align: center;
  padding: 18px 0 8px 0;
  font-size: 1.04rem;
  letter-spacing: 0.1px;
  border-top: 1.5px solid #eaeaea;
}
.footer-oasis .flag {
  font-size: 1.5rem;
  margin-right: 6px;
}

/* Admin Login Modal */
.admin-login-box {
  width: 405px;
  padding: 34px 35px 34px 35px;
  background: linear-gradient(134deg, #ecf2ff 60%, #fffffff7 100%);
  box-shadow: 0 8px 40px 0 rgba(42, 32, 92, 0.12);
  border-radius: 22px;
  align-items: center;
}
.admin-login-header {
  width: 100%;
  text-align: center;
  margin-bottom: 28px;
}
.admin-avatar {
  font-size: 3.3rem;
  background: linear-gradient(45deg, #4b68fa 40%, #1ecab8 100%);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 2px 7px 0 #8883;
  margin-bottom: 7px;
}
.admin-login-header h2 {
  margin: 9px 0 3px 0;
  font-size: 1.44rem;
  color: #23244f;
}
.admin-login-sub {
  font-size: 1.02rem;
  color: #5e6391;
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}
.admin-login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.admin-login-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-label {
  font-size: 0.98rem;
  color: #374274;
  margin-left: 2px;
  margin-bottom: 1.5px;
  font-weight: 500;
}
.admin-login-form input[type="text"],
.admin-login-form input[type="password"] {
  padding: 11px 14px;
  border: 1.5px solid #dbe5ef;
  border-radius: 10px;
  background: #f7faff;
  font-size: 1rem;
  color: #23244f;
  transition: border 0.17s;
}
.admin-login-form input:focus {
  border-color: #5c84ea;
  outline: none;
  background: #f0f6ff;
}
.admin-login-btn {
  width: 100%;
  background: linear-gradient(90deg, #3253ec 60%, #1ecab8 100%);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 12px 0;
  margin-top: 10px;
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: 0 2px 14px #2540c511;
  transition: background 0.16s, box-shadow 0.16s;
}
.admin-login-btn:hover {
  background: linear-gradient(90deg, #2230c6 40%, #17997e 100%);
  box-shadow: 0 3px 18px #1ecab82c;
}

/* Responsive */
@media (max-width: 900px) {
  .modal-bookinfo {
    padding: 12px 6vw 18px 10px;
    width: 98vw;
  }
  .book-modal-content {
    flex-direction: column;
    gap: 11px;
    align-items: center;
  }
  .book-modal-details {
    max-width: 96vw;
  }
}
@media (max-width: 600px) {
  .books-grid {
    gap: 18px 4px;
  }
  .book-card {
    width: 98vw;
    min-width: 95vw !important;
  }
  .modal-menu {
    padding: 9vw 3vw 5vw 3vw;
    width: 94vw !important;
  }
}
