/* Universal Selectors */

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  background-color: #f9f2e9;
  color: #1e1e1e;
  font-family: "Zain", sans-serif;
  font-weight: 400;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 2.5rem;
}

p {
  font-size: 2rem;
}

/* Header */

.header {
  background-color: #c5b6a3;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #1e1e1e;
  position: relative;
}

.header__title {
  text-decoration: none;
  color: #1e1e1e;
  font-size: 2rem;
  line-height: 1;
  margin: 0;
  padding: 0.5rem;
  font-weight: 800;
}

.header__links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header__links a {
  color: inherit;
  font-size: 1.25rem;
  text-decoration: none;
  transition: 0.3s;
}

.header__links a:hover {
  transform: scale(1.05);
  color: #f9f2e9;
}

.header__links img {
  max-width: 2.4rem;
  max-height: 2.4rem;
  border-radius: 50%;
  border: 1px solid #1e1e1e;
}

.header .sign-in-button {
  background-color: #928677;
  padding: 0.05rem 1rem;
  border-radius: 0.5rem;
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #1e1e1e;
}

.navbar-icon {
  width: 28px;
  height: 28px;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
  }

  .hamburger {
    display: flex;
  }

  .header__links {
    display: none; /* hidden by default on mobile */
    flex-direction: column;
    width: 100%;
    text-align: center;
    background-color: #c5b6a3;
    padding: 1rem 0;
    border-top: 2px solid #1e1e1e;
  }

  .header__links.show {
    display: flex; /* toggled open */
  }

  .header__links a {
    font-size: 1.5rem;
    padding: 0.5rem 0;
  }
}

/* Footer */

.footer {
  padding: 1rem 2.2rem;
  background-color: #c5b6a3;
  border-top: 2px solid #1e1e1e;
}

.footer-flex-container {
  display: flex;
  justify-content: space-between;
}

#footer-year {
  font-size: 1.3rem;
}

.footer-cr {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-cr p {
  font-size: 1rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-contact h3 {
  font-size: 1.4rem;
}

.footer-contact p {
  font-size: 1.2rem;
}

.footer-contact-links {
  display: flex;
  gap: 1rem;
}

.footer-links {
  all: unset;
  transition: 0.2s;
  color: #797065;
}

.footer-links:hover {
  transform: scale(1.05);
  color: #f9f2e9;
  cursor: pointer;
}

@media (max-width: 768px) {
  .footer-flex-container {
    flex-wrap: wrap;
  }
}

/* Homepage Books Section */

.books {
  padding: 2rem;
}

.book {
  background-color: #ddd1c3;
  display: flex;
  gap: 2rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 2rem;
  border: 2px solid #1e1e1e;
  flex-wrap: wrap; /* ensures content wraps on smaller screens */
}

.book img {
  border-radius: 1.25rem;
  border: 1px solid #1e1e1e;
  max-width: 200px;
  width: 100%;
  object-fit: cover;
}

.book-desc {
  flex: 1;
  min-width: 200px;
}

.book-desc h3 {
  font-size: 1.7rem;
}

.book-btn {
  margin-top: 1rem;
  font-size: 1.2rem;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem;
  background-color: #928677;
  color: white;
  text-decoration: none;
  transition: 0.3s;
}

.book-btn:hover {
  background-color: #c5b6a3;
}

@media (max-width: 768px) {
  .book {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    gap: 1rem;
  }

  .book-desc {
    text-align: center;
  }

  .book-btn {
    margin-top: 1rem;
  }
}

/* Homepage intro */

.intro {
  background-color: #f9f2e9;
  padding: 3.5rem 3.5rem 1.5rem 3.5rem;
  text-align: center; /* centers text nicely on small screens */
}

.intro h1,
.intro h2 {
  font-family: "Poppins", sans-serif;
  line-height: 1.2;
}

.intro-greet {
  font-size: clamp(2.5rem, 5vw, 6rem);
  /* 
     - min: 2.5rem (small phones)
     - preferred: scales with viewport width
     - max: 6rem (big desktops)
  */
}

.intro-desc {
  font-size: clamp(1rem, 2.5vw, 2rem);
  font-weight: 500;
  max-width: 60ch; /* keeps text comfortably readable */
  margin: 1rem auto 0 auto; /* centers block on page */
  color: #333; /* softer contrast for body text */
}

/* Per book notes section */
.notes-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.back-button-container {
  width: 95%;
  margin: 1.5rem 0 2rem 0;
}

.back-button {
  text-decoration: none;
  font-size: 1.5rem;
  color: #1e1e1e;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: 0.2s;
}

.back-button:hover {
  color: #827c73;
  transform: scale(2);
}

@media (max-width: 768px) {
  .back-button-container {
    width: 100%;
  }
}

.notes-book {
  width: 100%;
  margin-left: 3rem;
  padding: 1rem 1rem 1rem 5rem;
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

.notes-book img {
  margin: 1rem 2rem;
  border-radius: 1.25rem;
  border: 1px solid #1e1e1e;
}

.notes-desc {
  margin-top: 2.75rem;
  flex: 1;
}

@media (max-width: 768px) {
  .notes-book {
    flex-direction: column;
    padding: 1rem 1rem 1rem 1rem;
    margin-left: 0;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
  }

  .notes-desc {
    margin-top: 0.5rem;
  }

  .notes-book img {
    max-width: 150px;
  }
}

.notes-notes {
  width: 70%;
  padding: 1rem 3rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.notes-notes ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 1.75rem;
  gap: 1rem;
  padding-left: 1rem;
  list-style: none; /* optional if you keep custom bullets */
}

.notes-title {
  align-self: center; /* centers only this element */
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .notes-notes {
    width: 90%;
    padding: 1rem;
  }

  .notes-notes ul {
    font-size: 1.5rem;
  }

  .notes-title {
    font-size: 2rem;
  }
}

.notes-comments {
  width: 90%;
  max-width: 1000px; /* caps width on big screens */
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.notes-comments-form-container {
  display: flex;
  flex-direction: column;
}

.notes-comments-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-comments-form textarea {
  resize: none;
  height: 5rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 1.25rem;
}

.notes-comments-form button {
  display: flex;
  justify-content: center;
  max-width: 150px;
}

.notes-comments-form label {
  font-size: 2.25rem;
  font-weight: 600;
}

.notes-form-button {
  display: flex;
  justify-content: flex-end;
}

.notes-comments-show {
  width: 90%;
  max-width: 1000px; /* same as form section for consistency */
  margin: 0 auto; /* center it */
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-comments-show-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.notes-comments-show-comment {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 1px solid #1e1e1e;
  background-color: #f9f6f4;
  width: 100%;
  font-size: 1.5rem; /* readable on desktop */
  line-height: 1.6;
  box-sizing: border-box;
  word-wrap: break-word;
}

.notes-comments-show-container ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-comments-show-comment-imgname {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.notes-comments-show-comment-imgname img {
  border-radius: 50%;
  height: 2.25rem;
  width: 2.25rem;
  border: 1px solid #1e1e1e;
}

.notes-comments-show-comment p {
  font-size: clamp(1.3rem, 1.5vw, 1.75rem); /* responsive font size */
  margin: 0;
  line-height: 1.5;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .notes-comments,
  .notes-comments-show {
    width: 95%;
    padding: 1rem;
  }

  .notes-comments-form button {
    max-width: 100%;
  }

  .notes-comments-show-comment {
    font-size: 1.3rem;
    padding: 1rem;
  }

  .notes-comments-show-comment-imgname img {
    height: 2rem;
    width: 2rem;
  }

  .notes-comments-form label {
    font-size: 1.75rem;
  }
}

/* Login Page */

.login {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f9f2e9;
  padding: 1rem;
}

.login-form-container {
  background-color: #ddd1c3;
  border-radius: 1rem;
  width: 35%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  gap: 0.5rem;
  border: 2px solid #1e1e1e;
}

.login-form-container h2 {
  font-size: 2.5rem !important;
  color: #1e1e1e;
}

.login-form-container p {
  font-size: 1rem !important;
  color: #827c73;
}

.login-button {
  padding: 1rem;
}

.login-button-link {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-radius: 1rem;
  padding: 1rem 3rem;
  background-color: #c5b6a3;
  text-decoration: none;
  color: #f9f2e9;
  font-size: 1.5rem;
  transition: 0.1s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.login-button-link:hover {
  transform: scale(1.05);
  background-color: #b7a792;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-button-link img {
  height: 1.5rem;
  width: 1.5rem;
  color: #827c73;
}

@media (max-width: 1024px) {
  .login-form-container {
    width: 50%;
  }
}

@media (max-width: 768px) {
  .login-form-container {
    width: 80%;
    padding: 2rem 1rem;
  }

  .login-form-container h2 {
    font-size: 2.5rem;
  }

  .login-button-link {
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
  }
}

/* Admin Page */

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 3rem; /* space between children */
  min-height: 100dvh;
  justify-content: flex-start; /* align from top */
  align-items: center;
  padding: 2rem 0; /* space from top and bottom of page */
}

.form-box {
  min-width: 30%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  border-radius: 2rem;
  border: 2px solid #1e1e1e;
  background-color: #f9f6f4;
  margin-bottom: 2rem;
}

.form-box img {
  max-width: 15rem;
  max-height: 20rem;
}

.form-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  align-items: flex-start;
}

.form-container form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 90%;
}

.form-container form label {
  font-size: 1.75rem;
  margin-bottom: 0;
}

.form-container form input {
  font-size: 1rem;
  border-radius: 0.25rem;
  width: 90%;
  height: 2rem;
  padding: 0.5rem;
  transition: 0.3s;
}

.form-container form input:hover {
  scale: 1.05;
}

.form-container form input:focus {
  scale: 1.05;
}

.form-container form button {
  all: unset;
  cursor: pointer;
  font-size: 1.25rem;
  background-color: #ffffff;
  padding: 0.25rem 1rem;
  margin-top: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid #1e1e1e;
  transition: 0.1 s;
}

.form-container form button:hover {
  scale: 1.05;
}

.form-container form p {
  font-size: 1rem;
}

.books-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 3rem;
  border: 2px solid #1e1e1e;
  border-radius: 2rem;
  background-color: #f9f6f4;
  margin-top: 2rem;
}

.books-list ul {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-books {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid #1e1e1e;
  border-radius: 1rem;
  background-color: #ffffff;
}

.admin-books img {
  max-width: 6rem;
}

.admin-books-flex-1 {
  display: flex;
  flex-direction: column;
}

.admin-books-flex-1 strong {
  font-size: 2rem;
}

.admin-books-flex-2 {
  display: flex;
  gap: 0.5rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* tinted background */
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal form label {
  font-size: 1.25rem;
}

.hidden {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .form-box {
    flex-direction: column;
    width: 90%;
    padding: 2rem;
  }

  .form-box img {
    max-width: 12rem;
    margin-top: 1rem;
  }

  .form-container form input,
  .form-container form button {
    width: 100%;
  }

  .books-list {
    width: 95%;
    padding: 2rem;
  }

  .admin-books {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-books img {
    max-width: 8rem;
    margin-bottom: 1rem;
  }

  .admin-books-flex-2 {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
}

@media (max-width: 768px) {
  .form-container form label {
    font-size: 1.25rem;
  }

  .form-container form input {
    font-size: 0.95rem;
    padding: 0.4rem;
  }

  .form-container form button {
    font-size: 1rem;
    padding: 0.4rem 0.75rem;
  }

  .admin-books-flex-1 strong {
    font-size: 1.5rem;
  }

  .admin-books-flex-2 button,
  .admin-books-flex-2 a {
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
  }

  .admin-books {
    gap: 0.5rem;
    padding: 1rem;
  }

  .form-box img {
    max-width: 10rem;
  }
}

/* Edit Notes Section */

.admin-notes-list {
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.admin-notes-flex {
  width: 100%;
  max-width: 800px; /* keeps content readable on large screens */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.admin-notes-title {
  display: flex;
  justify-content: center;
  width: 100%;
}

.admin-notes-flex ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.admin-note-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.admin-note-container-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap; /* buttons wrap on small screens */
}

.dark-brown-button {
  all: unset;
  font-size: 1.25rem;
  padding: 0.1rem 1rem;
  border-radius: 0.3rem;
  background-color: #c5b6a3;
  color: #f9f6f4;
}

.dark-brown-button:hover {
  transform: scale(1.05);
  cursor: pointer;
}

.admin-note {
  padding: 0.5rem 1rem;
  border: 1px solid #1e1e1e;
  border-radius: 0.25rem;
  background-color: #f9f6f4;
  word-wrap: break-word; /* prevent overflow on long notes */
}

.create-notes-form form {
  display: flex;
  flex-direction: column; /* stack input and button on small screens */
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  width: 100%;
}

.create-notes-form form label {
  font-size: 1.5rem;
}

.create-notes-form form button {
  width: clamp(2rem, 3rem, 4rem);
}

.create-notes-form form input {
  width: 100%;
  font-size: 1.25rem;
  padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
  .create-notes-form form {
    flex-direction: row; /* show input and button in one row on larger screens */
    align-items: center;
    gap: 1rem;
  }

  .create-notes-form form input {
    flex: 1; /* input takes remaining space */
  }

  .create-notes-form form button {
    width: auto;
  }

  .admin-note-container-buttons {
    justify-content: flex-start;
  }
}

@media (min-width: 1024px) {
  .admin-notes-flex {
    max-width: 900px;
  }
}

/* Bar */

.horizontal-bar {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.black-bar {
  background-color: #1e1e1e;
  border: 1px solid #1e1e1e;
  width: 85vw;
}
