/* ========== ОБЩИЕ СТИЛИ ========== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f6f8;
  margin: 0;
  padding: 20px;
  color: #333;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

/* ========== КНОПКИ ========== */
button {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 8px 16px;
  margin-right: 5px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover {
  background-color: #357ab8;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

/* Вкладки CHAPTERS */
#tabs {
  display: flex;
  flex-wrap: wrap;       /* перенос на новую строку при нехватке места */
  gap: 8px;              /* расстояние между кнопками */
  margin-bottom: 15px;
}

#tabs button {
  background-color: #e0e5ec;
  color: #333;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  white-space: nowrap;   /* не переносить текст внутри кнопки */
  flex-shrink: 0;        /* кнопка не сжимается */
}

#tabs button.active {
  background-color: #4a90e2;
  color: white;
}

/* ========== ТАБЛИЦА PLACES ========== */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

thead {
  background-color: #4a90e2;
  color: white;
}

thead th {
  padding: 10px;
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
  background-color: #f0f4f8;
  cursor: pointer;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-content h3 {
  margin-top: 0;
  font-size: 18px;
  color: #4a90e2;
  text-align: center;
}

/* ========== ПОЛЯ ФОРМЫ ========== */
.modal-content label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #555;
}

.modal-content input[type="text"],
.modal-content select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 4px;
  font-size: 14px;
  transition: border 0.2s;
}

.modal-content input[type="text"]:focus,
.modal-content select:focus {
  border-color: #4a90e2;
  outline: none;
}

/* ========== ДЕЙСТВИЯ МОДАЛКИ ========== */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* ========== ЧЕКБОКС ========== */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* ========== ЗАГРУЗКА ========== */
#loader {
  margin-top: 10px;
  font-style: italic;
  color: #888;
}

/* ========== ОТЗЫВЧИВОСТЬ ========== */
@media (max-width: 480px) {
  .modal-content {
    width: 90%;
    padding: 15px;
  }

  button {
    padding: 6px 12px;
    font-size: 13px;
  }

  thead th, tbody td {
    padding: 8px;
    font-size: 13px;
  }
}

/* Звёздочки для оценки */
.star-rating {
  display: flex;
  gap: 2px;
}

.star {
  font-size: 16px;
  color: #ccc; /* серые пустые */
}

.star.filled {
  color: #f5a623; /* золотые подсвеченные */
}

.star:hover,
.star.hovered {
  color: #f5a623;
}

.edit-btn {
  background-color: #f5a623;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.2s;
}

.edit-btn:hover {
  background-color: #d48806;
}
