@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
  background-size: cover;
  color: #e0e0e0;
  backdrop-filter: blur(2px);
}

header {
  background-color: rgba(18, 18, 18, 0.85);
  color: #00bcd4;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid #333;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
}

main {
  background-color: rgba(18, 18, 18, 0.85);
  padding: 2rem;
  max-width: 900px;
  margin: 3rem auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

#book-list, #book-form, #additional-books, #pickup-address, #loan-form {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 10px;
  background-color: rgba(30, 30, 47, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#book-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#book-form input {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #1e1e2f;
  color: #fff;
  transition: border-color 0.3s ease;
}

#book-form input:focus {
  border-color: #00bcd4;
  outline: none;
}

#book-form button {
  padding: 0.75rem;
  font-size: 1rem;
  background-color: #ffca28;
  color: #121212;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#book-form button:hover {
  background-color: #f4b400;
  transform: scale(1.05);
}

.book-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #ffd54f;
}

.book-author {
  font-size: 1em;
  font-style: italic;
  color: #b0bec5;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  background-color: rgba(30, 30, 47, 0.9);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease;
}

li:hover {
  transform: scale(1.02);
}

button {
  background-color: #ffca28;
  color: #121212;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #f4b400;
  transform: scale(1.05);
}

.book-actions {
  display: flex !important;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

li .book-actions .edit-btn {
  background-color: #4caf50 !important;
  color: white !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  margin: 0 !important;
}

li .book-actions .edit-btn:hover {
  background-color: #45a049 !important;
  color: white !important;
}

li .book-actions .delete-btn {
  background-color: #f44336 !important;
  color: white !important;
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  margin: 0 !important;
}

li .book-actions .delete-btn:hover {
  background-color: #da190b !important;
  color: white !important;
}

#additional-books ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#additional-books li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background-color: rgba(30, 30, 47, 0.9);
  border-radius: 8px;
}

#additional-books .book-title,
#additional-books .book-author {
  flex: 1;
}

#additional-books button {
  margin-left: 10px;
}

#mensagem {
  display: none;
  margin-top: 10px;
  font-weight: bold;
  transition: opacity 0.5s ease;
}

@media (max-width: 600px) {
  main {
    padding: 1rem;
    margin: 1rem;
  }

  #book-form input,
  #book-form button,
  #loan-form input,
  #loan-form button {
    width: 100%;
    margin-bottom: 10px;
  }

  li {
    flex-direction: column;
    align-items: flex-start;
  }

  .book-actions {
    margin-top: 10px;
    width: 100%;
    justify-content: flex-start;
  }

  .book-actions button {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
}

/* Estilos do Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: rgba(30, 30, 47, 0.95);
  margin: 10% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  background-color: #00bcd4;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close {
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: white;
  line-height: 1;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 1.5rem;
}

#form-reserva {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#form-reserva label {
  color: #e0e0e0;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#form-editar label {
  color: #e0e0e0;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
  margin-top: 1rem;
}

.livro-info {
  background-color: #1e1e2f;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.livro-info strong {
  display: block;
  color: #ffd54f;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.livro-info span {
  color: #b0bec5;
  font-style: italic;
}

.livro-info span::before {
  content: "por ";
}

.status-info {
  background-color: #2196f3;
  color: white;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-info i {
  font-size: 1.1rem;
}

#form-reserva select,
#form-reserva input,
#form-editar input {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #1e1e2f;
  color: #fff;
  transition: border-color 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

#form-reserva select:focus,
#form-reserva input:focus,
#form-editar input:focus {
  border-color: #00bcd4;
  outline: none;
}

#form-editar input::placeholder {
  color: #888;
  opacity: 0.8;
}

#form-editar input:first-of-type {
  margin-top: 0.5rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-cancelar {
  background-color: #666 !important;
  color: white !important;
  flex: 1;
}

.btn-cancelar:hover {
  background-color: #555 !important;
}

.btn-reservar {
  background-color: #00bcd4 !important;
  color: white !important;
  flex: 2;
}

.btn-reservar:hover {
  background-color: #00acc1 !important;
}

.btn-remover {
  background-color: #f44336 !important;
  color: white !important;
  flex: 1;
}

.btn-remover:hover {
  background-color: #d32f2f !important;
}

.btn-editar {
  background-color: #ff9800 !important;
  color: white !important;
  flex: 2;
}

.btn-editar:hover {
  background-color: #f57c00 !important;
}

@media (max-width: 600px) {
  .modal-content {
    margin: 5% auto;
    width: 95%;
  }
  
  .modal-buttons {
    flex-direction: column;
  }
}
