.border-library {
  border-color: var(--border-soft);
}

.btn-library {
  background: linear-gradient(to right, var(--emerald), var(--emerald-light));
  color: white;
  border: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-library:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(26, 138, 103, 0.2);
  color: white;
}

.btn-outline-library {
  color: var(--emerald);
  border: 1px solid var(--emerald);
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-library:hover {
  background-color: var(--emerald);
  color: white;
  box-shadow: 0 4px 8px rgba(26, 138, 103, 0.2);
  border-color: var(--emerald);
}

.library-btn-user {
  color: var(--brown-dark);
  background-color: var(--surface-soft);
  border: 1px solid var(--gold-dark);
  transition: all 0.3s ease;
}

.library-btn-user:hover {
  background-color: rgba(212, 175, 55, 0.2);
  transform: translateY(-1px);
}

.library-btn-login,
.library-btn-register,
.library-btn-logout {
  position: relative;
  overflow: hidden;
}

.library-btn-login::after,
.library-btn-register::after,
.library-btn-logout::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.library-btn-login:hover::after,
.library-btn-register:hover::after,
.library-btn-logout:hover::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0) translate(-50%);
    opacity: 0.5;
  }
  100% {
    transform: scale(24, 24) translate(-50%);
    opacity: 0;
  }
}

.library-card {
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s ease;
  background-color: var(--cream);
  border: 1px solid var(--border-soft) !important;
}

.library-card:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

.library-card .card-header {
  border-bottom: 1px solid var(--border-soft);
}

.library-table th {
  font-weight: 600;
  color: var(--brown-dark);
}

.library-table th,
.library-table td {
  vertical-align: middle;
}

.library-table-row {
  transition: all 0.2s ease;
}

.library-table-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.statistics-card {
  transition: transform 0.2s ease;
}

.statistics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08) !important;
}

.library-count-badge {
  font-size: 0.85rem;
  font-weight: 500;
  background-color: var(--cream);
  color: var(--brown-dark);
  border: 1px solid var(--border-soft);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.library-count-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card {
  border-radius: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background-color: var(--cream);
  border: 1px solid var(--border-soft);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08) !important;
}

.stat-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-book-card {
  background: var(--surface-elevated);
  border-color: var(--border-soft) !important;
}

.sortable-header a {
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s ease;
}

.sortable-header a:hover {
  color: var(--emerald-dark) !important;
  text-decoration: underline;
}

.comment-thread-item:last-child {
  border-bottom: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.comment-body {
  white-space: pre-wrap;
  color: var(--brown-dark);
}

.comment-state {
  white-space: pre-wrap;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-style: italic;
}

.deleted-state {
  background-color: rgba(220, 53, 69, 0.08);
  color: #842029;
  border: 1px solid rgba(220, 53, 69, 0.15);
}

.issue-status-badge {
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.issue-status-open {
  background-color: rgba(13, 110, 253, 0.12);
  color: #0d6efd;
  border: 1px solid rgba(13, 110, 253, 0.22);
}

.issue-status-in-progress {
  background-color: rgba(255, 193, 7, 0.18);
  color: #7a5900;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.issue-status-resolved {
  background-color: rgba(25, 135, 84, 0.14);
  color: #146c43;
  border: 1px solid rgba(25, 135, 84, 0.24);
}

.issue-status-closed {
  background-color: rgba(108, 117, 125, 0.16);
  color: #495057;
  border: 1px solid rgba(108, 117, 125, 0.26);
}

.issue-type-badge {
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.issue-type-bug {
  background-color: rgba(220, 53, 69, 0.14);
  color: #842029;
  border: 1px solid rgba(220, 53, 69, 0.24);
}

.issue-type-feature {
  background-color: rgba(23, 162, 184, 0.14);
  color: #0c5460;
  border: 1px solid rgba(23, 162, 184, 0.24);
}

body[data-theme='dark'] .issue-type-bug {
  background-color: rgba(207, 102, 121, 0.18);
  color: #ffdce3;
  border: 1px solid rgba(207, 102, 121, 0.36);
}

body[data-theme='dark'] .issue-type-feature {
  background-color: rgba(66, 201, 154, 0.16);
  color: #d2fff0;
  border: 1px solid rgba(66, 201, 154, 0.34);
}

.issue-priority-badge {
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.issue-priority-critical {
  background-color: rgba(220, 53, 69, 0.16);
  color: #721c24;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.issue-priority-high {
  background-color: rgba(255, 193, 7, 0.18);
  color: #7a5900;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.issue-priority-medium {
  background-color: rgba(255, 159, 64, 0.16);
  color: #6d4c41;
  border: 1px solid rgba(255, 159, 64, 0.26);
}

.issue-priority-low {
  background-color: rgba(108, 117, 125, 0.14);
  color: #383d41;
  border: 1px solid rgba(108, 117, 125, 0.22);
}

@media (max-width: 992px) {
  .library-count-badge {
    margin: 0.5rem 0;
    display: inline-block;
  }
}

.debug-only {
  display: none !important;
}

body.debug-enabled .debug-only {
  display: block !important;
}

body.debug-enabled .debug-only.d-flex {
  display: flex !important;
}

body.debug-enabled .debug-only.d-inline-flex {
  display: inline-flex !important;
}

body.debug-enabled .debug-only.d-block {
  display: block !important;
}

.dev-debug-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

.dev-debug-toggle.active {
  background: linear-gradient(135deg, #127151, #1a8a67);
  border-color: #127151;
  color: #fff;
}

.dev-debug-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  width: min(92vw, 340px);
  max-height: 68vh;
  overflow: auto;
  z-index: 1079;
  background: rgba(15, 23, 42, 0.97);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.9rem;
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.5);
  padding: 0.85rem;
}

.dev-debug-panel-hidden {
  display: none;
}

.dev-debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.dev-debug-section {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.6rem;
  background: rgba(30, 41, 59, 0.65);
}

.dev-debug-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.dev-debug-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.5rem;
  font-size: 0.78rem;
}

.dev-debug-grid strong {
  color: #f8fafc;
  font-family: 'Space Mono', monospace;
  font-size: 0.77rem;
}

.dev-debug-insights {
  margin: 0;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
}

.author-details-page #authorEnrichmentSourceBadge[data-source='cache'] {
  background-color: #334155 !important;
}

.author-details-page #authorEnrichmentSourceBadge[data-source='loading'] {
  background-color: #7a5900 !important;
}

.author-details-page #authorEnrichmentSourceBadge[data-source='live'],
.author-details-page #authorEnrichmentSourceBadge[data-source='in-flight'] {
  background-color: #146c43 !important;
}

.author-details-page #authorEnrichmentSourceBadge[data-source='error'] {
  background-color: #842029 !important;
}

.library-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.library-alert-overlay[hidden] {
  display: none !important;
}

.library-alert-dialog {
  width: min(100%, 460px);
  border-radius: 0.9rem;
  background: var(--cream);
  border: 1px solid rgba(74, 44, 15, 0.14);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.library-alert-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  color: #fff;
  background: linear-gradient(to right, var(--emerald), var(--emerald-light));
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.library-alert-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.library-alert-body {
  padding: 1rem;
  color: var(--brown-dark);
  white-space: pre-wrap;
}

.library-alert-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.8rem 1rem 1rem;
}

.library-alert-footer .btn {
  min-width: 86px;
}

.library-alert-input-wrap {
  padding: 0 1rem 0.2rem;
}

.library-alert-input {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid rgba(74, 44, 15, 0.2);
  background: #fff;
  color: var(--brown-dark);
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
}

.library-alert-input:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 0.2rem rgba(26, 138, 103, 0.12);
}
