/* Book Club Selector Container */
.book-club-selector {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Main Swiper Container */
.book-main-swiper {
    margin-bottom: 30px;
    border-radius: 16px;
    position: relative;
}

/* Book Preview Card */
.book-preview {
    display: flex;
    gap: 40px;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.book-preview.slide-changing {
    opacity: 0;
    transform: translateY(20px);
}

/* Book Cover Section */
.book-preview-image {
    width: 300px;
    height: 300px;
    position: relative;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    overflow: visible;
}

.book-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.book-preview-image:hover {
    transform: translateY(-5px);
}

/* Default Cover */
.default-cover {
    width: 100%;
    height: 100%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.book-icon {
    width: 40%;
    height: 40%;
    color: #a0a0a0;
}

/* Book Content Section */
.book-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Ribbon for Current Book */
.ribbon {
    --f: 0.5em; /* control the folded part */
    position: absolute;
    top: 0;
    right: 0;
    line-height: 1.8;
    padding: 0 1.2em var(--f);
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: #1a73e8;
    border-image: conic-gradient(#0008 0 0) 51%/var(--f);
    clip-path: polygon(
        100% calc(100% - var(--f)),
        100% 100%,
        calc(100% - var(--f)) calc(100% - var(--f)),
        var(--f) calc(100% - var(--f)),
        0 100%,
        0 calc(100% - var(--f)),
        999px calc(100% - var(--f) - 999px),
        calc(100% - 999px) calc(100% - var(--f) - 999px)
    );
    transform: translate(calc((1 - cos(45deg))*100%), -100%) rotate(45deg);
    transform-origin: 0% 100%;
    z-index: 2;
}

/* Book Title */
.book-title {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.2;
}

/* Book Author */
.book-author {
    font-size: 18px;
    color: #666;
    margin: 0 0 20px;
}

/* Book Description */
.book-description {
    font-size: 16px;
    line-height: 1.6;
    color: #424242;
    margin: 0 0 30px;
    flex-grow: 1;
}

/* Book Metadata */
.book-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 30px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.meta-icon {
    width: 20px;
    height: 20px;
    color: #1a73e8;
}

/* Listen Button */
.listen-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
}

.listen-button:hover {
    background: #1557b0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.listen-icon {
    width: 24px;
    height: 24px;
}

/* Loading State */
.listen-button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.listen-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    right: 16px;
    animation: spin 1s linear infinite;
}

/* Thumbnails Navigation */
.book-thumbs-swiper {
    padding: 20px 0;
    margin: 0 -20px;
}

.book-thumbs-swiper .swiper-slide {
    width: 120px;
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

/* Book Thumbnail */
.book-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow: visible;
}

.book-thumb:hover {
    transform: translateY(-3px);
}

.book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.book-thumb-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Add ribbon to thumbnail */
.book-thumb .ribbon {
    --f: 0.3em;
    font-size: 10px;
    padding: 0 0.8em var(--f);
    line-height: 1.6;
}



/* Error Message */
.book-club-error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #d32f2f;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

/* Player Container */
.book-club-player-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .book-preview {
        padding: 30px;
        gap: 30px;
    }

    .book-preview-image {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .book-preview {
        flex-direction: column;
        padding: 20px;
        gap: 24px;
        align-items: center;
    }

    .book-preview-image {
        width: 200px;
        height: 200px;
    }

    .book-preview-content {
        text-align: center;
        align-items: center;
    }

    .book-thumbs-swiper .swiper-slide {
        width: 100px;
    }

    .book-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .book-preview-image {
        width: 160px;
        height: 160px;
    }

    .book-meta {
        flex-wrap: wrap;
        justify-content: center;
    }

    .book-thumbs-swiper .swiper-slide {
        width: 80px;
    }

    .book-club-nav.swiper-button-next,
    .book-club-nav.swiper-button-prev {
        width: 36px;
        height: 36px;
    }

    .book-club-nav::after {
        font-size: 16px;
    }
}