/* General styles */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: url(background.jpeg);
  box-sizing: border-box;
   width: 100%;
}

header {
  padding: 20px;
  color: black;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

header h1 {
  margin: 0;
  font-size: 45px;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.library-title {
  text-decoration: none;
  color: inherit;
}

.library-title h1 {
  display: inline;
}

.add-button {
  padding: 8px 15px;
  font-size: 14px;
  background-color: white;
  color: black;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.add-button:hover {
  background-color: #F0FFFF;
}

.sort-form {
  margin: 0;
}

.sort-dropdown {
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background: white;
}

/* Search Form Section */
.search-section {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.search-sort-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-group {
  display: flex;
  gap: 5px;
}

input#search {
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 300px;
}

.search-button {
  padding: 8px 12px;
  font-size: 14px;
  color: white;
  background-color: #0056b3;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-button:hover {
  background-color: #004494;
}

/* Search Results Section */
.search-result-container {
  width: 100%;
  margin: 30px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  background-color: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

/* Main grid layout */
main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 20px;
}

/* Scroll container for books */
.scroll-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 960px;
  overflow: hidden;
}

/* Scroll buttons */
.scroll-button {
  background-color: rgba(0, 0, 0, 0.1);
  border: none;
  font-size: 30px;
  cursor: pointer;
  padding: 10px;
  z-index: 10;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.scroll-button.left {
  left: 10px;
}

.scroll-button.right {
  right: 10px;
}

.scroll-button:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

/* Horizontal book grid */
.book-grid {
  display: flex;
  gap: 20px;
  overflow-x: scroll;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  width: 100%;
  transition: transform 0.3s ease-in-out;
}

/* Single book card */
.book-card {
  flex: 0 0 200px;
  height: 450px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .book-card {
    flex: 0 0 calc(33.33% - 20px);
  }
}

@media (max-width: 768px) {
  .book-card {
    flex: 0 0 calc(50% - 20px);
  }
}

@media (max-width: 480px) {
  .book-card {
    flex: 0 0 calc(100% - 20px);
  }
}

/* Book cover styling */
.book-cover {
  width: 100%;
  height: 300px;
  border-radius: 5px;
  margin-bottom: 10px;
}

/* Title, author, and delete button */
.book-card h3 {
  margin: 2px 0;
  font-size: 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.book-card h3 a {
  text-decoration: none;
  color: #007bff;
  font-weight: bold;
  font-size: 20px;
}

.book-card p {
  font-size: 14px;
  margin: 2px 0;
}

.book-card h3 a:hover {
  text-decoration: underline;
  color: #0056b3;
}

/* Delete button */
.delete-form {
  margin-top: auto;
}

.delete-form button {
  padding: 5px 10px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 10px;
}

.delete-form button:hover {
  background-color: #c82333;
}

/* Styling for Add Book and Add Author pages */
.styled-form {
  width: 100%;
  max-width: 800px;
  margin: 50px auto;
  background-color: #FFF;
  border: 1px solid #DDD;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.styled-form label {
  font-weight: bold;
  margin-top: 10px;
  display: block;
  color: #333;
}

.styled-form input[type="text"],
.styled-form input[type="date"],
.styled-form select {
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.styled-form select {
  padding-right: 30px;
}

.styled-form input[type="submit"] {
  background-color: #007bff;
  color: white;
  padding: 12px 0;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s;
}

.styled-form input[type="submit"]:hover {
  background-color: #0056b3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .styled-form {
    max-width: 600px;
    padding: 20px;
  }

  .styled-form input[type="text"],
  .styled-form input[type="date"],
  .styled-form select {
    font-size: 14px;
    padding: 10px;
  }

  .styled-form input[type="submit"] {
    font-size: 14px;
    padding: 12px 0;
  }
}

@media (max-width: 480px) {
  .styled-form {
    max-width: 100%;
    padding: 15px;
  }

  .styled-form input[type="text"],
  .styled-form input[type="date"],
  .styled-form select {
    font-size: 14px;
  }

  .styled-form input[type="submit"] {
    font-size: 14px;
    padding: 10px 0;
  }
}

/* Success and warning messages */
.alert {
  padding: 10px;
  margin-bottom: 50px auto;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-warning {
  background-color: #f8d7da;
  color: #721c24;
}

/* Detail page unified layout */
.detail-container {
  display: flex;
  justify-content: center;
  margin-top: 60px;
}

.book-info {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 30px;
  max-width: 700px;
  width: 100%;
  text-align: center;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.book-info h1 {
  font-size: 28px;
  margin-bottom: 25px;
  color: #007bff;
}
.book-cover-container {
  width: 150px;
  height: 200px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

.author-info {
  margin: 10px 0 5px;
  font-size: 18px;
  color: #333;
}

.author-dates {
  font-size: 16px;
  color: #666;
  margin-bottom: 15px;
}

.book-info p {
  margin: 10px 0;
  font-size: 18px;
}

.book-info h3 {
  margin-top: 25px;
  font-size: 20px;
  color: #333;
}

footer {
  text-align: center;
  margin-top: 50px;
}

.author-dates .date {
  font-size: 0.8rem;
  font-style: italic;
  color: #555;
    }
}
