/* Bookshelf API Plugin Styles */

.bookshelf-container {
  margin: 20px 0;
}

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

.bookshelf-controls .button {
  background: #0073aa;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bookshelf-controls .button:hover {
  background: #005a87;
}

.bookshelf-controls .button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.refresh-status {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.refresh-status.success {
  color: #46b450;
}

.refresh-status.error {
  color: #dc3232;
}

/* Table Styles */
#bookshelf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

#bookshelf-table th {
  background-color: #f9f9f9;
  font-weight: 600;
  padding: 12px 8px;
  text-align: left;
  border-bottom: 2px solid #ddd;
}

#bookshelf-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

#bookshelf-table tbody tr:hover {
  background-color: #f5f5f5;
}

/* Rating Stars */
.star {
  color: #ffc107;
  font-size: 16px;
  margin-right: 2px;
}

.star.empty {
  color: #ddd;
}

/* Review Text */
.review-text {
  max-width: 200px;
  cursor: pointer;
  position: relative;
}

.review-text:hover {
  color: #0073aa;
}

.review-tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 300px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  top: 100%;
  left: 0;
  margin-top: 5px;
}

.review-tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 10px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #333;
}

/* Error and No Data Messages */
.bookshelf-error,
.bookshelf-no-data {
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.bookshelf-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.bookshelf-no-data {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #b8daff;
  text-align: center;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0073aa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .bookshelf-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .review-text {
    max-width: 150px;
  }

  .review-tooltip {
    max-width: 250px;
  }

  #bookshelf-table {
    font-size: 14px;
  }

  #bookshelf-table th,
  #bookshelf-table td {
    padding: 8px 6px;
  }
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
  padding: 4px 6px;
  margin: 0 5px;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 6px 10px;
  margin-left: 8px;
}

.dataTables_wrapper .dataTables_info {
  padding-top: 15px;
  font-size: 14px;
  color: #666;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 12px;
  margin-left: 2px;
  display: inline-block;
  cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f5f5f5;
  border-color: #ddd;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #0073aa;
  color: white !important;
  border-color: #0073aa;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #005a87;
  border-color: #005a87;
}
