/* Book Gallery Styles */

/* Container */
.book-gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Filter Form */
.book-gallery-filter {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.book-gallery-filter-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.book-gallery-filter-item {
    flex: 1;
    min-width: 200px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.book-gallery-filter-item:last-child {
    margin-right: 0;
}

.book-gallery-filter-item input,
.book-gallery-filter-item select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.book-gallery-filter-button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.book-gallery-filter-button:hover {
    background-color: #005177;
}

/* Sorting */
.book-gallery-sorting {
    margin-bottom: 20px;
    text-align: right;
}

.book-gallery-sorting-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Grid View */
.book-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.book-gallery-item {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-gallery-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-gallery-item-image {
    position: relative;
    padding-top: 140%; /* Aspect ratio for book covers */
    overflow: hidden;
}

.book-gallery-item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.book-gallery-item:hover .book-gallery-item-image img {
    transform: scale(1.05);
}

.book-gallery-item-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-gallery-item-title {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.3;
}

.book-gallery-item-title a {
    color: #333;
    text-decoration: none;
}

.book-gallery-item-title a:hover {
    color: #0073aa;
}

.book-gallery-item-formats,
.book-gallery-item-categories,
.book-gallery-item-authors {
    margin-bottom: 8px;
    font-size: 13px;
}

.book-gallery-item-format,
.book-gallery-item-category,
.book-gallery-item-author {
    display: inline-block;
    margin-right: 5px;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}

.book-gallery-item-format:hover,
.book-gallery-item-category:hover,
.book-gallery-item-author:hover {
    background-color: #e0e0e0;
    color: #333;
}

.book-gallery-item-price {
    margin-top: auto;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.book-gallery-item-regular-price {
    color: #333;
}

.book-gallery-item-sale-price {
    color: #cc0000;
    margin-left: 5px;
}

.book-gallery-item-buttons {
    display: flex;
    gap: 10px;
}

.book-gallery-item-button {
    flex: 1;
    display: inline-block;
    padding: 8px 12px;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background-color 0.3s;
}

.book-gallery-item-buy-button {
    background-color: #0073aa;
    color: white;
}

.book-gallery-item-button:hover {
    background-color: #e0e0e0;
}

.book-gallery-item-buy-button:hover {
    background-color: #005177;
}

/* List View */
.book-gallery-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.book-gallery-list-item {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-gallery-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-gallery-list-item-inner {
    display: flex;
    flex-direction: row;
}

.book-gallery-list-item-image {
    flex: 0 0 150px;
    padding: 15px;
}

.book-gallery-list-item-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 3px;
}

.book-gallery-list-item-details {
    flex: 1;
    padding: 15px;
}

.book-gallery-list-item-title {
    margin: 0 0 10px;
    font-size: 18px;
}

.book-gallery-list-item-title a {
    color: #333;
    text-decoration: none;
}

.book-gallery-list-item-title a:hover {
    color: #0073aa;
}

.book-gallery-list-item-authors,
.book-gallery-list-item-categories,
.book-gallery-list-item-formats {
    margin-bottom: 8px;
    font-size: 14px;
}

.book-gallery-list-item-label {
    font-weight: bold;
    margin-right: 5px;
}

.book-gallery-list-item-author,
.book-gallery-list-item-category,
.book-gallery-list-item-format {
    display: inline-block;
    margin-right: 5px;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}

.book-gallery-list-item-author:hover,
.book-gallery-list-item-category:hover,
.book-gallery-list-item-format:hover {
    background-color: #e0e0e0;
    color: #333;
}

.book-gallery-list-item-excerpt {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.book-gallery-list-item-rating {
    margin-bottom: 10px;
}

.book-gallery-list-item-star {
    color: #ccc;
    font-size: 16px;
}

.book-gallery-list-item-star-filled {
    color: #ffb900;
}

.book-gallery-list-item-price {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

.book-gallery-list-item-regular-price {
    color: #333;
}

.book-gallery-list-item-sale-price {
    color: #cc0000;
    margin-left: 5px;
}

.book-gallery-list-item-buttons {
    display: flex;
    gap: 10px;
}

.book-gallery-list-item-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.book-gallery-list-item-buy-button {
    background-color: #0073aa;
    color: white;
}

.book-gallery-list-item-button:hover {
    background-color: #e0e0e0;
}

.book-gallery-list-item-buy-button:hover {
    background-color: #005177;
}

/* Slider View */
.book-gallery-slider-wrapper {
    position: relative;
    margin: 30px 0;
}

.book-gallery-slider {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.book-gallery-slider-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 20px;
}

.book-gallery-slider-item-inner {
    display: flex;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-gallery-slider-item-image {
    flex: 0 0 40%;
    padding: 20px;
}

.book-gallery-slider-item-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.book-gallery-slider-item-details {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.book-gallery-slider-item-title {
    margin: 0 0 15px;
    font-size: 24px;
}

.book-gallery-slider-item-title a {
    color: #333;
    text-decoration: none;
}

.book-gallery-slider-item-title a:hover {
    color: #0073aa;
}

.book-gallery-slider-item-categories,
.book-gallery-slider-item-authors {
    margin-bottom: 10px;
    font-size: 16px;
}

.book-gallery-slider-item-category,
.book-gallery-slider-item-author {
    display: inline-block;
    margin-right: 5px;
    padding: 3px 8px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}

.book-gallery-slider-item-category:hover,
.book-gallery-slider-item-author:hover {
    background-color: #e0e0e0;
    color: #333;
}

.book-gallery-slider-item-rating {
    margin: 10px 0;
}

.book-gallery-slider-item-star {
    color: #ccc;
    font-size: 20px;
}

.book-gallery-slider-item-star-filled {
    color: #ffb900;
}

.book-gallery-slider-item-buttons {
    margin-top: auto;
    display: flex;
    gap: 15px;
}

.book-gallery-slider-item-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.book-gallery-slider-item-download-button {
    background-color: #4caf50;
    color: white;
}

.book-gallery-slider-item-buy-button {
    background-color: #0073aa;
    color: white;
}

.book-gallery-slider-item-button:hover {
    opacity: 0.9;
}

.book-gallery-slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 1;
}

.book-gallery-slider-prev,
.book-gallery-slider-next {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
}

.book-gallery-slider-prev:hover,
.book-gallery-slider-next:hover {
    background-color: white;
}

.book-gallery-slider-title,
.book-gallery-slider-subtitle {
    text-align: center;
}

.book-gallery-slider-subtitle {
    color: #666;
    font-style: italic;
}

/* Category View */
.book-gallery-category-title {
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.book-gallery-category-section {
    margin-bottom: 40px;
}

.book-gallery-category-name {
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.book-gallery-category-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.book-gallery-category-book {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-gallery-category-book:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-gallery-category-book-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-gallery-category-book-image {
    position: relative;
    padding-top: 140%;
    overflow: hidden;
}

.book-gallery-category-book-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.book-gallery-category-book:hover .book-gallery-category-book-image img {
    transform: scale(1.05);
}

.book-gallery-category-book-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-gallery-category-book-title {
    margin: 0 0 10px;
    font-size: 15px;
    line-height: 1.3;
}

.book-gallery-category-book-title a {
    color: #333;
    text-decoration: none;
}

.book-gallery-category-book-title a:hover {
    color: #0073aa;
}

.book-gallery-category-book-formats {
    margin-bottom: 8px;
    font-size: 12px;
}

.book-gallery-category-book-format {
    display: inline-block;
    margin-right: 5px;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-decoration: none;
}

.book-gallery-category-book-format:hover {
    background-color: #e0e0e0;
    color: #333;
}

.book-gallery-category-book-authors {
    margin-bottom: 8px;
    font-size: 12px;
}

.book-gallery-category-book-author-label {
    font-weight: bold;
    margin-right: 5px;
}

.book-gallery-category-book-author {
    color: #666;
    text-decoration: none;
}

.book-gallery-category-book-author:hover {
    color: #0073aa;
}

.book-gallery-category-book-price {
    margin-top: auto;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

.book-gallery-category-book-regular-price {
    color: #333;
}

.book-gallery-category-book-sale-price {
    color: #cc0000;
    margin-left: 5px;
}

.book-gallery-category-book-buttons {
    display: flex;
}

.book-gallery-category-book-button {
    flex: 1;
    display: inline-block;
    padding: 6px 10px;
    background-color: #0073aa;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.3s;
}

.book-gallery-category-book-button:hover {
    background-color: #005177;
}

.book-gallery-category-view-more {
    text-align: right;
    margin-top: 15px;
}

.book-gallery-category-view-more-link {
    display: inline-block;
    padding: 5px 15px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.book-gallery-category-view-more-link:hover {
    background-color: #e0e0e0;
}

.book-gallery-category-divider {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* Author Panel */
.book-gallery-author-title {
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

.book-gallery-author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.book-gallery-author-item {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-gallery-author-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.book-gallery-author-item-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-gallery-author-item-image {
    text-align: center;
    padding: 20px 20px 0;
}

.book-gallery-author-item-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #f0f0f0;
}

.book-gallery-author-item-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-gallery-author-item-name {
    margin: 0 0 15px;
    font-size: 18px;
    text-align: center;
}

.book-gallery-author-item-name a {
    color: #333;
    text-decoration: none;
}

.book-gallery-author-item-name a:hover {
    color: #0073aa;
}

.book-gallery-author-item-bio {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.book-gallery-author-item-link {
    margin-top: auto;
    text-align: center;
}

.book-gallery-author-item-view-books {
    display: inline-block;
    padding: 8px 20px;
    background-color: #0073aa;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.book-gallery-author-item-view-books:hover {
    background-color: #005177;
}

/* Pagination */
.book-gallery-pagination {
    margin-top: 30px;
    text-align: center;
}

.book-gallery-pagination .page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.book-gallery-pagination .page-numbers.current {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

.book-gallery-pagination .page-numbers:hover {
    background-color: #f0f0f0;
}

.book-gallery-pagination .page-numbers.current:hover {
    background-color: #0073aa;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .book-gallery-filter-row {
        flex-direction: column;
    }
    
    .book-gallery-filter-item {
        margin-right: 0;
        width: 100%;
    }
    
    .book-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .book-gallery-list-item-inner {
        flex-direction: column;
    }
    
    .book-gallery-list-item-image {
        flex: 0 0 auto;
        text-align: center;
    }
    
    .book-gallery-list-item-image img {
        max-width: 150px;
    }
    
    .book-gallery-slider-item-inner {
        flex-direction: column;
    }
    
    .book-gallery-slider-item-image {
        flex: 0 0 auto;
        padding: 20px 20px 0;
    }
    
    .book-gallery-category-books {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .book-gallery-author-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .book-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .book-gallery-category-books {
        grid-template-columns: 1fr 1fr;
    }
    
    .book-gallery-author-grid {
        grid-template-columns: 1fr;
    }
}
