/* Featured Carousel Component Styles - Modern Hero Design with Offset Content */
.featured-carousel-container {
    width: 100%;
    margin: 0 auto 3rem auto;
    position: relative;
    overflow: visible;
}

.featured-hero-bg {
    /* New background gradient using brand colors */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 70%, var(--highlight-color) 100%);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    border: none;
    padding: 0;
    min-height: 550px;
    overflow: visible;
    animation: fadeIn 1.2s cubic-bezier(.4,0,.2,1);
    margin: 2.5rem auto;
    max-width: 1300px;
    padding-bottom: 2.5rem; /* Added padding to create more space at the bottom */
}

.featured-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1;
    padding: 3rem 0;
}

.featured-hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Offset content box that extends outside the container - with fixed height */
.featured-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Changed from center to allow for fixed height */
    padding: 3rem;
    background: rgba(255,255,255,0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    width: 50%;
    max-width: 620px;
    height: 440px; /* Fixed height for all content boxes */
    z-index: 3;
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%) translateX(0);
    opacity: 0;
    animation: slideInFromLeft 1s forwards 0.3s;
    overflow: hidden; /* Prevent content from spilling out */
}

@keyframes slideInFromLeft {
    0% {
        transform: translateY(-50%) translateX(-3rem);
        opacity: 0;
    }
    100% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    background: var(--highlight-color);
    color: #222;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    margin-bottom: 1.2rem;
    width: fit-content;
}

.featured-title {
    font-weight: 900;
    color: var(--primary-color);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.featured-author {
    font-size: 1.2rem;
    color: var(--background-dark);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Fixed-height container for the description to ensure consistent sizing */
.featured-description {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--background-dark);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    max-width: 90%;
    flex: 1; /* Allow description to take available space */
    overflow-y: auto; /* Add scrolling if content is too long */
}

.featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.7rem 1.5rem;
    border-radius: 2rem;
    background: linear-gradient(90deg, var(--primary-color) 60%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--box-shadow-light);
    width: fit-content;
    margin-top: auto; /* Push the button to the bottom of flex container */
}

.featured-cta:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-heavy);
    color: white;
    text-decoration: none;
}

/* Book cover with adjusted position - moved more to the left */
.featured-hero-image-container {
    position: absolute;
    right: 7rem; /* Adjusted from 3rem to 7rem to move the book more to the left */
    top: 50%;
    transform: translateY(-50%);
    height: 90%;
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 2;
}

.featured-hero-image {
    max-height: 90%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    transform: perspective(800px) rotateY(-15deg) translateZ(20px);
    transition: transform 0.5s ease;
    opacity: 0;
    animation: fadeIn 1s forwards 0.5s;
}

.featured-hero-image:hover {
    transform: perspective(800px) rotateY(-5deg) translateZ(30px) scale(1.02);
}

/* Improved indicators positioning - moved down further from content */
.featured-indicators {
    position: absolute;
    bottom: 1rem; /* Changed from 2.5rem to move further down */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.7rem; /* Increased from 0.5rem for better spacing */
    z-index: 5;
}

.featured-indicator {
    width: 2.5rem;
    height: 0.4rem; /* Slightly thicker for better visibility */
    background: rgba(255, 255, 255, 0.6); /* Increased opacity from 0.4 to 0.6 */
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.featured-indicator.active {
    background: var(--highlight-color);
}

/* Enhanced visibility for navigation buttons - moved down further from content */
.featured-controls {
    position: absolute;
    bottom: 1rem; /* Changed from 2.5rem to move further down */
    right: 2.5rem; /* Moved slightly more to the right */
    display: flex;
    gap: 0.7rem;
    z-index: 5;
}

.featured-button {
    width: 3.2rem; /* Slightly larger */
    height: 3.2rem; /* Slightly larger */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25); /* Increased from 0.15 for better visibility */
    border: 2px solid rgba(255, 255, 255, 0.6); /* Increased border opacity from 0.4 */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s, transform 0.15s;
    font-size: 1.2rem; /* Added to make icons larger */
}

.featured-button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.featured-button:active {
    transform: scale(0.98);
}

/* Repositioned and enhanced pause/play button */
.featured-playback {
    position: absolute;
    top: 1.5rem; /* Moved to top-right instead of bottom-left */
    right: 1.5rem;
    z-index: 5;
    width: 2.8rem; /* Slightly larger */
    height: 2.8rem; /* Slightly larger */
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25); /* Increased from 0.15 for better visibility */
    border: 2px solid rgba(255, 255, 255, 0.6); /* Added border for better visibility */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1.1rem; /* Added to make icon larger */
}

.featured-playback:hover {
    background: rgba(255, 255, 255, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive styles */
@media (max-width: 992px) {
    .featured-hero-content {
        padding: 2rem;
        left: -1rem;
        width: 55%;
        height: 350px; /* Adjusted for medium screens */
    }
    
    .featured-title {
        font-size: 2rem;
    }
    
    .featured-hero-image-container {
        right: 4rem; /* Adjusted for medium screens */
        width: 42%;
    }
}

/* Mobile layout completely revised to reduce excessive height */
@media (max-width: 768px) {
.featured-hero-slide {
    position: absolute;
    top: 0;
    left: 10px;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: row;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1;
    padding: 3rem 0;
    height: 100%; /* Ensure full height */
    width: 100%; /* Ensure full width */
}

/* Make sure the .featured-hero-bg has position: relative and proper overflow handling */
.featured-hero-bg {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 70%, var(--highlight-color) 100%);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    border: none;
    padding: 0;
    min-height: 350px;
    overflow: hidden; /* Change from 'visible' to 'hidden' to clip any content outside the container */
    animation: fadeIn 1.2s cubic-bezier(.4,0,.2,1);
    margin: 2.5rem auto;
    max-width: 1300px;
    padding-bottom: 2.5rem;
}
    
    /* Content box - position to the left */
    .featured-hero-content {
        position: absolute; /* Change from relative to absolute */
        left: 0;
        top: 50%;
        transform: translateY(-50%); /* Center vertically */
        width: 80%;
        max-width: 100%;
        margin: 0;
        padding: 1rem 1.2rem;
        height: auto;
        height: 280px;
        animation: fadeIn 1s forwards 0.3s;
        z-index: 2;
    }
    
    /* Book image container - adjusted position */
    .featured-hero-image-container {
        position: absolute;
        width: 140px;
        height: 210px;
        right: 30px;
        top: 50%;
        transform: translateY(-50%) perspective(800px) rotateY(-12deg);
        justify-content: flex-end;
        padding: 0;
        z-index: 3;
    }
    
    .featured-hero-image {
        max-height: 100%;
        max-width: 100%;
        transform: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    }
    
    .featured-hero-image:hover {
        transform: scale(1.05);
    }
    
    /* Adjust content spacing */
    .featured-title {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
        padding-right: 60px; /* More space for book */
    }
    
    .featured-badge {
        margin-bottom: 0.6rem;
    }
    
    .featured-author {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .featured-description {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        max-height: 70px; /* Smaller height */
        padding-right: 40px;
    }
    
    .featured-controls {
        bottom: 0.6rem;
        right: 1rem;
    }
    
    .featured-button {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .featured-indicators {
        bottom: 0.6rem;
    }
    
    .featured-playback {
        top: 1rem;
        right: 1rem;
        width: 2.2rem;
        height: 2.2rem;
    }
}

/* Small phones */
@media (max-width: 576px) {
    .featured-hero-bg {
        min-height: 350px;
        padding-bottom: 0.3rem;
        overflow: hidden; /* Add this to ensure content doesn't overflow */
    }

    .featured-hero-slide {
        position: absolute; /* Add this to enforce absolute positioning */
        top: 20px;
        left: 0;
        right: 0;
        bottom: 0;
        height: 300px;
        width: 100%;
        padding: 0.8rem;
    }

    .featured-hero-content {
        position: absolute; /* Change from inherited relative to absolute */
        left: 10px;
        top: 50%;
        transform: translateY(-50%); /* Center vertically */
        padding: 0.8rem;
        max-height: 270px;
        width: 82%;
    }
    
    .featured-hero-image-container {
        width: 110px; /* Smaller width */
        height: 165px; /* Smaller height */
        right: 10px; /* Less protrusion */
    }
    
    .featured-title {
        font-size: 1.3rem;
        padding-right: 30px;
    }
    
    .featured-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .featured-author {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .featured-description {
        font-size: 0.85rem;
        margin-bottom: 0.7rem;
        max-height: 100px;
        line-height: 1.3;
        padding-right: 30px;
    }
    
    .featured-cta {
        padding: 0.45rem 0.9rem;
        font-size: 0.85rem;
    }
    
    .featured-controls {
        bottom: 0.5rem;
        right: 0.7rem;
    }
    
    .featured-button {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
    
    .featured-indicators {
        bottom: 0.5rem;
    }
    
    .featured-playback {
        top: 0.7rem;
        right: 0.7rem;
        width: 1.8rem;
        height: 1.8rem;
    }
}