/* ============================================
   📖 Books - Book Cards & Related Styles
   ============================================ */

/* Book Card - Horizontal Layout with bottom actions */
.book-card {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--color-border);
    position: relative;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Book Avatar/Cover */
.book-avatar {
    position: relative;
    width: 80px;
    height: 100px;
    min-width: 80px;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
    background-color: var(--color-bg-tertiary);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* Book Info - Right Side */
.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

.book-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    margin-top: 4px;
    flex-wrap: wrap;
}

.book-readers,
.book-holder {
    display: flex;
    align-items: center;
    gap: 6px;
}

.book-readers .readers-icon,
.book-holder .holder-icon {
    font-size: 0.875rem;
}

/* Book Status - Compact Row with Indicator */
.book-status-col {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-warning);
}

.book-rating .rating-star {
    font-size: 0.875rem;
}

/* Status Indicator - Лампочка */
.book-status-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px currentColor, inset 0 0 4px rgba(255,255,255,0.3);
    flex-shrink: 0;
    cursor: help;
    position: relative;
    transition: all var(--transition-base);
}

.book-status-indicator.available {
    background: radial-gradient(circle at 30% 30%, #4ade80, #22c55e);
    box-shadow: 0 0 12px #22c55e, inset 0 0 4px rgba(255,255,255,0.4);
}

.book-status-indicator.reading {
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    box-shadow: 0 0 12px #dc2626, inset 0 0 4px rgba(255,255,255,0.4);
    animation: pulse-reading 2s ease-in-out infinite;
}

@keyframes pulse-reading {
    0%, 100% {
        box-shadow: 0 0 12px #dc2626, inset 0 0 4px rgba(255,255,255,0.4);
    }
    50% {
        box-shadow: 0 0 20px #dc2626, inset 0 0 6px rgba(255,255,255,0.5);
    }
}

/* Book Actions - кнопки дій внизу карточки */
.book-actions {
    display: flex;
    gap: var(--space-xs);
    width: 100%;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.book-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background-color: var(--color-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
    font-size: 1.125rem;
}

.book-action-btn.danger {
    background-color: var(--color-danger);
}

.book-action-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.book-action-btn:active {
    transform: translateY(0);
}

.book-avatar,
.book-info {
    cursor: pointer;
}

/* Responsive - Books */
@media (max-width: 768px) {
    .book-avatar {
        width: 60px;
        height: 80px;
        min-width: 60px;
        font-size: 1.5rem;
    }
    
    .book-title {
        font-size: 0.9375rem;
    }
    
    .book-author {
        font-size: 0.8125rem;
    }
    
    .book-status-col {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .book-card {
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .book-avatar {
        width: 50px;
        height: 70px;
        min-width: 50px;
        font-size: 1.25rem;
    }
    
    .book-status-col {
        min-width: 60px;
    }
}
.book-avatar{
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden; /* важливо, щоб обрізати, якщо щось піде не так */
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;     /* прибирає зайві inline-особливості */
  flex: 0 0 auto;     /* щоб flex не “переміряв” картинку як треба */
  min-width: 0;       /* додатковий запобіжник для flex */
}