/**
 * Book Carousel Component Styles
 */

.book-carousel-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
    max-width: 100%;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.dark .book-carousel-container {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.book-carousel-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
}

.dark .book-carousel-header {
    border-bottom-color: #374151;
}

.book-carousel-header h3 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #4338ca;
    text-transform: uppercase;
    margin: 0;
}

.dark .book-carousel-header h3 {
    color: #818cf8;
}

.book-carousel-viewport {
    position: relative;
    min-height: 480px;
    display: flex;
    justify-content: center;
}

.book-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-carousel-slide.active {
    opacity: 1;
    visibility: visible;
}

/* 3D Cover Effects */
.book-cover-wrapper {
    position: relative;
    perspective: 1000px;
    margin-bottom: 20px;
    text-decoration: none;
    display: inline-block;
}

.book-cover-inner {
    width: 180px;
    aspect-ratio: 2 / 3;
    background: #000;
    border-radius: 4px 12px 12px 4px;
    box-shadow:
        10px 10px 20px rgba(0, 0, 0, 0.15),
        2px 0 5px rgba(0, 0, 0, 0.1);
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    overflow: hidden;
    /* Cropping happens here */
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .book-cover-inner {
    background: #000;
}

.book-cover-wrapper:hover .book-cover-inner {
    transform: rotateY(-5deg) rotateX(2deg) scale(1.05);
}

.book-cover-3d {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Combined with scale to trim edges without excessive cropping */
    display: block;
    border: none;
    outline: none;
    transform: scale(1.03);
    /* Zoom just enough to skip original white borders */
    transition: transform 0.3s ease;
    object-position: center;
}

/* AI Badge */
.book-ai-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
    pointer-events: none;
}

/* Book Info */
.book-info {
    text-align: center;
    padding: 0 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.book-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
    margin-bottom: 6px;
    max-width: 200px;
    text-align: center;
}

.dark .book-title {
    color: #f9fafb;
}

.book-genre {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 500;
}

.dark .book-genre {
    color: #9ca3af;
}

.book-rating {
    margin-bottom: 12px;
    color: #fbbf24;
    font-size: 14px;
}

.book-rating .reviews {
    color: #9ca3af;
    font-size: 12px;
    margin-left: 4px;
}

.book-formats {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 20px;
    font-weight: 600;
}

.book-cta-btn {
    display: inline-block;
    background: #e67e22;
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.book-cta-btn:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
    color: white !important;
}

/* Navigation Dots */
.book-carousel-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: #4338ca;
    width: 24px;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 1024px) {
    .book-carousel-container {
        padding: 20px 10px;
    }
}

@media (max-width: 640px) {
    .book-cover-inner {
        width: 160px;
    }

    .book-carousel-viewport {
        min-height: 460px;
    }
}