* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #f0f4f8;
  color: #2d3748;
}

header {
  background-color: #008cff;
  color: white;
  padding: 18px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

/* sections */
.addBook,
.searchBook,
.incompleteBook,
.completeBook {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  width: 75%;
  margin: 16px auto;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.addBook h2,
.searchBook h2,
.incompleteBook h2,
.completeBook h2 {
  margin-top: 0;
  color: #008cff;
  font-size: 1.1rem;
  text-align: start;
  letter-spacing: 0.3px;
}

/* add book section */
.addBook form > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 12px;
}

label {
  margin-bottom: 5px;
  color: #008cff;
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #008cff;
  box-shadow: 0 0 0 3px rgba(0, 140, 255, 0.15);
}

.addBook .readCheck {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.readCheck label {
  margin: 0;
  line-height: 1;
}

.readCheck input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #008cff;
  cursor: pointer;
  flex-shrink: 0;
}

button#bookFormSubmit {
  background-color: #008cff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  width: 100%;
  font-size: 1rem;
  margin-top: 4px;
}

/* search section */
.searchBook form > div {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.searchBook label[for="searchBookTitle"] {
  margin: 0;
  margin-right: 10px;
  font-size: 0.95rem;
  white-space: nowrap;
}

.searchBook button {
  background-color: #008cff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 32px;
  margin-left: 10px;
  font-size: 1rem;
  white-space: nowrap;
}

/* book items */
.bookItem {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 10px 0;
  padding: 16px;
  text-align: start;
  transition: box-shadow 0.2s;
}

.bookItem:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bookItem h3 {
  margin: 0;
  font-size: 1rem;
  color: #1a202c;
}

.bookItem p {
  margin: 0;
  font-size: 0.9rem;
  color: #718096;
}

.bookItem > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.bookItem button[data-testid="bookItemIsCompleteButton"] {
  background-color: #38a169;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.bookItem button[data-testid="bookItemDeleteButton"] {
  background-color: #e53e3e;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.bookItem button[data-testid="bookItemEditButton"] {
  background-color: #008cff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

/* editing*/
.bookItem.editing {
  border: 2px solid #008cff !important;
  box-shadow: 0 0 0 4px rgba(0, 140, 255, 0.12);
  background-color: #f0f7ff;
}

.saveEditButton,
.cancelEditButton {
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.9rem;
}

.saveEditButton {
  background-color: #38a169;
}

.cancelEditButton {
  background-color: #e53e3e;
}

button {
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

button:active {
  opacity: 1;
  transform: translateY(0);
}