/* Global Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9fafc;
  color: #333;
  line-height: 1.6;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Header */
header {
  background-color: #4CAF50;
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  font-family: 'Lucida Grande';

}

header .tagline {
  font-size: 15px;
  margin-top: 10px;
  font-weight: normal;
}

/* Adjust search and filter bar */
.search-filter,
.export-import {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}


/* Controls & Actions */
#controls, #actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

#controls input[type="text"],
#controls select,
#actions button {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
  border: 1px solid #ccc;
}

#controls input[type="text"] {
  flex: 2;
  min-width: 200px;
}

#controls select {
  flex: 1;
  min-width: 150px;
}

#sort {
  flex: 1;
  min-width: 150px;
}

#actions button {
  border: none;
  cursor: pointer;
}

#add-book-btn {
  background-color: #4CAF50;
  color: white;
}

#clear-library-btn {
  background-color: #f44336;
  color: white;
}

#export {
  background-color: #008CBA;
  color: white;
}

#actions input[type="file"] {
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
}

#actions button:hover,
#actions input[type="file"]:hover {
  opacity: 0.9;
}

#book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
  padding: 0;
}

.book {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
}

.book:hover {
  transform: translateY(-5px);
}

.book.favorite {
  border: 2px solid gold;
  background-color: #fffdf0;
}

/* Book Details */
.book h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.book p.author {
  margin-bottom: 10px;
  font-style: italic;
  font-size: 13px;
  color: #555;
  text-align: left;
}

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

.book p strong {
  font-weight: bold;
}

.book p.rating {
  font-size: 14px;
  font-weight: bold;
  margin-top: 10px;
}

/* Book Actions */
.book-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: space-between;
}

.book-actions button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.book-actions button:first-of-type {
  background-color: #008CBA; /* Edit Button */
  color: white;
}

.book-actions button:last-of-type {
  background-color: #f44336; /* Delete Button */
  color: white;
}

.book-actions button:hover {
  opacity: 0.8;
}

/* Favorites Highlight */
.book.favorite {
  border: 2px solid gold;
  background-color: #fffbea;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-content h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
}

/* Modal Form Styling */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content select {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
}

.modal-content button {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #4CAF50;
  color: white;
  margin-top: 10px;
}

.modal-content button:hover {
  opacity: 0.9;
}

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

.close:hover {
  color: #000;
}


/* Footer */
footer {
  text-align: center;
  font-size: 12px;
  margin: 30px 0 10px;
  color: #888;
  background-color: #f1f1f1;
  padding: 10px 0;
  border-top: 1px solid #ddd;
}

footer a {
  color: #4CAF50;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  #controls,
  #actions {
    flex-direction: column;
    align-items: stretch;
  }

  #book-list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .modal-content {
    width: 95%;
  }

  .book-actions {
    flex-direction: column;
    gap: 5px;
  }

  main {
    padding: 0 20px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#book-count {
  margin: 20px 0;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

/* Custom Category Input */
#custom-category-group {
  width: 100%;
  margin-bottom: 10px;
}

#custom-category {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}
