.author-card {
  background-color: var(--card-background);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  cursor: pointer;

  &:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
  }

  &.selected {
    border: 2px solid var(--primary-color);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.cover-container {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--card-background);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-container:not(.loaded) {
  background: linear-gradient(
    90deg,
    var(--surface-ground) 25%,
    var(--surface-hover, rgba(255, 255, 255, 0.08)) 50%,
    var(--surface-ground) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.author-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease-in, transform 0.35s ease;
}

.author-photo.loaded {
  opacity: 1;
}

.author-card:hover .author-photo.loaded {
  transform: scale(1.04);
}

.author-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #64748b;
  background: color-mix(in srgb, var(--p-surface-800), transparent 20%);

  i {
    font-size: 3rem;
  }
}

.book-count-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 9px;
  border-radius: 10px;
  line-height: 1.3;
  z-index: 3;
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 2px 4px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.matched-icon {
  color: #22c55e;
  font-size: 0.85rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.author-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.menu-button-container {
  flex-shrink: 0;
}

::ng-deep .card-menu-btn .p-button {
  padding: 0.15rem 0.25rem !important;
  color: #fff !important;

  &:hover {
    background: rgba(255, 255, 255, 0.15) !important;
  }
}

.select-checkbox {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 3;

  @media (max-width: 767px) {
    top: 4px;
    right: 4px;
  }
}

.cover-container:hover .select-checkbox,
.author-card.selected .select-checkbox {
  opacity: 1;
  visibility: visible;
}
