/* Books page specific styles */
:root {
    --gold: #bba13e;
    --dark-text: #333;
    --light-text: #666;
    --background-light: #f8f8f6;
    --white: #fff;
    --transition-speed: 0.3s;
}

/* Hero Banner Section */
.books-hero {
    position: relative;
    background-image: url('../images/books-banner.jpg');
    background-size: cover;
    background-position: center;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.books-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.books-hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.books-hero p {
    font-size: 1.2rem;
    font-weight: 400;
    margin-top: 0;
}

/* Category Navigation */
.books-nav-section {
    background-color: #f4f3ec;
    padding: 20px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Book introduction and curated notice */
.book-introduction {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 0 20px;
}

.curated-notice {
    font-family: var(--font-heading);
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    font-style: italic;
    margin-bottom: 25px;
}

.curated-notice a {
    color: #8b6c42;
    text-decoration: none;
    border-bottom: 1px dotted #8b6c42;
    transition: all 0.3s ease;
}

.curated-notice a:hover {
    color: #5d4b2c;
    border-bottom: 1px solid #5d4b2c;
}

.category-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-nav-container button {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    background-color: white;
    border: none;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.category-nav-container button.active {
    background-color: var(--gold);
    color: white;
}

.category-nav-container button:hover {
    background-color: #e9e9e9;
}

.category-nav-container button.active:hover {
    background-color: var(--gold);
}

/* Books Filter and Grid Sections */
.books-filter-section {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.filter-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    background-color: white;
}

.books-grid-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.no-books-message {
    text-align: center;
    padding: 40px 0;
    font-size: 18px;
    color: #777;
}

.no-books-message.hidden {
    display: none;
}

/* Book Card Styles */
.book-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.book-cover {
    height: 350px;
    overflow: hidden;
    position: relative;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-text);
}

.book-original-title {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 15px;
    font-style: italic;
}

.book-meta {
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--light-text);
}

.book-meta p {
    margin: 5px 0;
}

.book-category {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.book-button {
    display: block;
    width: 100%;
    padding: 10px 0;
    background-color: var(--gold);
    color: white;
    text-align: center;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    text-decoration: none;
    margin-top: auto;
    border: none;
    cursor: pointer;
}

.book-button:hover {
    background-color: #a38b35;
}

/* Modal Styles */
.book-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 20;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 50px auto;
    padding: 0;
    width: 90%;
    max-width: 1000px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    position: relative;
    padding: 20px 40px;
    border-bottom: 1px solid #eee;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    display: flex;
    padding: 40px;
}

.modal-cover {
    flex: 0 0 300px;
    margin-right: 40px;
}

.modal-cover img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-details {
    flex: 1;
}

#modalTitle {
    font-size: 2.2rem;
    color: var(--dark-text);
    margin: 0;
}

.modal-info {
    margin-bottom: 25px;
}

.modal-info p {
    margin: 10px 0;
    font-size: 1rem;
    color: var(--light-text);
}

.modal-synopsis {
    margin-bottom: 30px;
}

.modal-synopsis h4,
.modal-awards h4 {
    font-size: 1.3rem;
    color: var(--dark-text);
    margin-bottom: 15px;
}

.synopsis-content {
    line-height: 1.6;
    color: var(--dark-text);
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.modal-awards {
    margin-bottom: 30px;
}

.modal-awards p {
    line-height: 1.6;
    color: var(--dark-text);
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.read-more-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--gold);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.read-more-link:hover {
    background-color: #a38b35;
}

.close-button-footer {
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: var(--dark-text);
    border: none;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 99;
}

.close-button-footer:hover {
    background-color: #e0e0e0;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--gold);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#backToTop:hover {
    background-color: #a38b35;
    transform: translateY(-3px);
}

#backToTop.visible {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Responsive Styles */
@media (max-width: 960px) {
    .books-banner {
        height: 240px;
    }
    
    .books-banner .banner-content {
        padding: 20px 30px 15px;
    }
    
    .books-banner h1 {
        font-size: 2rem;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .book-image {
        flex: none;
        margin-right: 0;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .book-image img {
        max-width: 250px;
    }
}

@media (max-width: 960px) {
    .category-tabs li {
        padding: 15px 20px;
        font-size: 0.9rem;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .book-cover {
        height: 280px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5vh auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .books-banner {
        height: 200px;
    }
    
    .books-banner h1 {
        font-size: 1.6rem;
    }
    
    .books-banner .subtitle {
        font-size: 1rem;
    }
    
    .book-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .book-cover {
        height: 220px;
    }
    
    .book-info {
        padding: 15px;
    }
    
    .book-info h3 {
        font-size: 1rem;
    }
}
