/* Library & Book Styles */

.library-section {
    background-color: #f8f5f2;
    /* Light paper color */
    padding: 3rem 2rem;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.library-shelf {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* Vertical gap between books */
    padding-bottom: 25px;
    /* border-bottom: 12px solid #8d6e63; Removed shelf line for list view */
    /* box-shadow: 0 5px 5px rgba(0,0,0,0.1); Removed shelf shadow */
    margin-bottom: 3rem;
    /* Align books to the bottom of the shelf */
    padding-bottom: 25px;
    border-bottom: 12px solid #8d6e63;
    /* Shelf wood color */
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
    /* Shelf shadow */
    margin-bottom: 3rem;
}

.book-item {
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    gap: 1.5rem;
    align-items: flex-start;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.book-cover-container {
    flex-shrink: 0;
    width: 140px;
    /* Fixed width for cover */
}

.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    /* Standard book ratio */
    background: #e0e0e0;
    border-radius: 4px 12px 12px 4px;
    /* Slight curve on right side */
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.2),
        inset 3px 0 2px rgba(255, 255, 255, 0.2),
        /* Highlight spine */
        inset -1px 0 2px rgba(0, 0, 0, 0.2);
    /* Shadow right */
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spine effect */
.book-cover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.1) 30%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0));
    z-index: 2;
}

.book-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #3e2723;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    text-align: left;
}

.book-meta {
    font-size: 0.9rem;
    color: #6d4c41;
    margin-bottom: 1rem;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.book-narration {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
}

.book-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
    /* Align left */
    gap: 0.75rem;
    opacity: 1;
    /* Always visible now */
    transform: none;
}

.book-item:hover .book-actions {
    opacity: 1;
    transform: none;
}

.btn-book {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    text-decoration: none;
    font-weight: 600;
}

.btn-read {
    background: #5d4037;
    color: #fff;
}

.btn-dl {
    background: #d97706;
    color: #fff;
}

/* Fallback for no image */
.no-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(135deg, #8d6e63, #5d4037);
    color: #efebe9;
    height: 100%;
}

.no-cover i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

/* Responsive adjustment */
@media (max-width: 600px) {
    .library-shelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}