/* ============================================================
   FACULTY BOOKS SECTION — With all your requested fixes
   ============================================================ */

/* Section Container */
.faculty-books-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header - Title and button on same line */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.75rem;
}

.section-header h2 {
    margin: 0;
    color: #005030;
    font-size: 1.8rem;
    font-weight: bold;
}

.submit-btn {
    background: #ffdf5c;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
    display: inline-block;
}

.submit-btn:hover {
    background: #f47321;
    color: white;
    text-decoration: none;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.filter-bar .search-wrapper {
    flex: 2;
    min-width: 200px;
}

.filter-bar .dropdown-wrapper {
    flex: 1;
    min-width: 150px;
}

#searchBooks {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}

#searchBooks:focus {
    border-color: #005030;
    box-shadow: 0 0 0 2px rgba(0, 80, 48, 0.1);
}

.filter-bar select {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
}

.filter-bar select:focus {
    border-color: #005030;
}

/* View Toggle Buttons with Icons */
.view-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.view-btn {
    background: #e0e0e0;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn i {
    font-size: 1rem;
}

.view-btn .btn-text {
    display: inline-block;
}

.view-btn.active {
    background: #005030;
    color: white;
}

.view-btn:hover:not(.active) {
    background: #ccc;
}

/* --- Grid View --- */
.books-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.books-container.grid-view .book-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.books-container.grid-view .book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* FIX 1: Cover bottom padding equal to top */
.books-container.grid-view .book-cover-wrapper {
    margin-bottom: 1rem;  /* was 0.85rem, now equal to top padding */
}

.books-container.grid-view .book-cover {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* --- List View --- */
.books-container.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.books-container.list-view .book-card {
    display: flex;
    gap: 1.25rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    transition: box-shadow 0.2s;
}

.books-container.list-view .book-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* FIX 2: Cover column wider in list view */
.books-container.list-view .book-cover-wrapper {
    flex-shrink: 0;
    width: 140px;  /* was 100px, now wider */
}

.books-container.list-view .book-cover {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.books-container.list-view .book-details {
    flex: 1;
}

/* --- Book Card Typography --- */
.book-title {
    font-size: 1rem;
    font-weight: bold;
    color: #005030;
    margin: 0 0 0.2rem 0;
    line-height: 1.3;
}

.book-subtitle {
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

/* FIX 3: Author name more bold (700 instead of 600) */
.book-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: #333;
    margin: 0 0 0.2rem 0;
}

/* FIX 4: Author name as link */
.book-author a {
    color: #333;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.book-author a:hover {
    color: #f47321;
}

.book-department {
    font-size: 0.75rem;
    color: #777;
    margin: 0 0 0.2rem 0;
}

.book-publisher {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 0.2rem 0;
}

.book-year {
    font-size: 0.75rem;
    color: #999;
    margin: 0 0 0.5rem 0;
}

/* FIX 5 & 6: Learn more - no underline on hover, turns orange */
.book-link {
    color: #005030;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: color 0.2s;
    margin-top: auto;
    display: inline-block;
}

.book-link:hover {
    color: #f47321;  /* turns orange on hover */
    text-decoration: none;  /* no underline */
}

/* No Cover Placeholder */
.no-cover {
    background: #f5f5f5;
    width: 100%;
    aspect-ratio: 2 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-style: italic;
    grid-column: 1 / -1;
}

/* Mobile Responsive */
@media (max-width: 700px) {
    .faculty-books-section {
        padding: 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar .search-wrapper,
    .filter-bar .dropdown-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .books-container.list-view .book-card {
        flex-direction: column;
    }
    
    /* Keep list view cover responsive but maintain width */
    .books-container.list-view .book-cover-wrapper {
        width: 100%;
        max-width: 140px;
    }
}

/* Hide text on very small screens, keep icons only */
@media (max-width: 480px) {
    .view-btn .btn-text {
        display: none;
    }
    
    .view-btn {
        padding: 0.5rem 0.75rem;
    }
    
    .view-btn i {
        margin: 0;
    }
}