/* Book Cover & Card Styles */
.book-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform, box-shadow;
}

.book-cover-wrapper {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #1a1a2e;
    will-change: transform, box-shadow;
}
.hot-book-cover {
    border-radius: 8px !important;
}

.book-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    will-change: transform;
}

/* Dynamic text cover fallback */
.book-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem 1rem 1rem 1.5rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    position: relative;
}

.book-cover-fallback .fallback-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-cover-fallback .fallback-author {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-card:hover .book-cover-wrapper {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(139, 92, 246, 0.3);
}

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

/* Badge styling */
.premium-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CSS Gradients for default covers */
.bg-grad-1 { background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%); }
.bg-grad-2 { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.bg-grad-3 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.bg-grad-4 { background: linear-gradient(135deg, #cc208e 0%, #6713d2 100%); }
.bg-grad-5 { background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%); }

/* Featured section special styles */
.featured-glow {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.15) !important;
    border: 1px solid rgba(255, 193, 7, 0.25) !important;
}
.featured-glow:hover {
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.35) !important;
    border-color: rgba(255, 193, 7, 0.5) !important;
}

/* Overrides for full-bleed (tràn viền) card layout */
.featured-slider .glass-card {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 8px !important;
}
.featured-slider .book-cover-wrapper {
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0 !important;
}

/* Slider layout */
.slider-container {
    position: relative;
    width: 100%;
}
.featured-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 15px 5px;
    -webkit-overflow-scrolling: touch; /* smooth scrolling for iOS Safari */
    scroll-snap-type: x mandatory; /* Snap scrolling for premium mobile experience */
}
.featured-slider::-webkit-scrollbar {
    display: none;
}
.slider-item {
    flex: 0 0 260px;
    width: 260px;
    scroll-snap-align: start;
}
.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 20, 30, 0.85);
    border: 1px solid var(--glass-border);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
}
.slider-nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
.slider-nav-btn.prev-btn {
    left: -22px;
}
.slider-nav-btn.next-btn {
    right: -22px;
}
@media (max-width: 991px) {
    .slider-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    }
    .slider-nav-btn.prev-btn {
        left: 2px;
    }
    .slider-nav-btn.next-btn {
        right: 2px;
    }
}
@media (max-width: 768px) {
    .featured-slider {
        gap: 0.85rem;
        padding: 10px 2px;
    }
    .slider-item {
        flex: 0 0 160px;
        width: 160px;
    }
    .slider-item .glass-card {
        padding: 0 !important;
    }
    .slider-item .book-cover-wrapper {
        margin-bottom: 0 !important;
    }
    .slider-item .d-flex.flex-column.flex-grow-1 {
        padding: 10px 8px !important;
    }
    .slider-item h6 {
        font-size: 0.82rem !important;
    }
}
