/* modals.css - Styles for modals */

/* Modal base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
  max-height: 90vh;
  margin: 10vh auto;
  overflow-y: auto;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #e74c3c;
}

.modal-body {
  padding: 20px;
}

/* Book form in modal */
#book-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

#book-form .form-group:nth-child(7),
#book-form .form-group:nth-child(8),
#book-form .form-actions {
  grid-column: 1 / span 2;
}

/* Responsive design */
@media (max-width: 768px) {
  #book-form {
    grid-template-columns: 1fr;
  }

  #book-form .form-group:nth-child(7),
  #book-form .form-group:nth-child(8),
  #book-form .form-actions {
    grid-column: 1;
  }

  .modal-content {
    width: 95%;
    margin: 5vh auto;
  }

  .modal-body {
    padding: 15px;
  }

  .form-group input,
  .form-group select {
    font-size: 0.9rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions button {
    width: 100%;
    padding: 10px;
  }
}
