/* Hero Billboard Component Styles - Flexible layout with book and text */

/* ===================================
   CONTAINER & BASE STYLES
   =================================== */
.hero-billboard-container {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
}

.hero-billboard {
    position: relative;
    width: 100%;
    min-height: 70vh;
    max-height: 85vh;
    overflow: hidden;
}

/* Ensure UI controls can receive clicks even with layered slides/backgrounds */
.hero-indicators,
.hero-nav-controls {
    pointer-events: auto;
    position: absolute;
    z-index: 50;
}

.hero-indicator,
.hero-nav-btn {
    pointer-events: auto;
}

/* ===================================
   SLIDE STRUCTURE
   =================================== */
/* Base slide styles */
.hero-billboard-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1000ms ease-in-out, visibility 1000ms ease-in-out;
    z-index: 1;
}

/* Incoming slide fades in on top */
.hero-billboard-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    animation: none !important; /* keep transition-driven crossfade */
}

/* Outgoing slide stays visible and fades out underneath */
.hero-billboard-slide.exiting {
    opacity: 0;
    visibility: visible;
    z-index: 1;
    animation: none !important;
}

/* Ensure background and content do not flash during crossfade */
.hero-billboard-background { will-change: opacity, transform; }
.hero-content-wrapper { will-change: opacity, transform; }

/* ===================================
   BACKGROUND STYLING
   =================================== */
.hero-billboard-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) saturate(1.3);
    transform: scale(1.08);
    z-index: 1;
    animation: heroZoomSlow 14s ease-in-out both; /* subtle Ken Burns */
}

/* Promotional image background - no blur, full quality */
.hero-billboard-background.promo-background {
    filter: none;
    transform: scale(1.02);
    background-size: cover;
    background-position: center center;
}

/* Overlay for text readability - REMOVED for brighter hero display */
.hero-billboard-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Overlay removed - no darkening */
    background: none;
    z-index: 2;
}

/* ===================================
   HERO CONTENT LAYOUT
   =================================== */
.hero-content-wrapper {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 4rem;
    gap: 3rem;
}

/* Book section */
.hero-book-section {
    flex-shrink: 0;
}

.hero-book-image {
    max-height: 50vh;
    max-width: 280px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: none;
    transform: perspective(1000px) rotateY(-5deg);
    transition: transform 0.4s ease;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(8px) perspective(1000px) rotateY(-5deg);
}

.hero-book-image:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

/* Text section */
.hero-text-section {
    flex: 1;
    max-width: 600px;
}

.hero-headline {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 0.75rem 0;
    line-height: 1.15;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(10px);
}

.hero-subheadline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
    /* Intro animation defaults */
    opacity: 0;
    transform: translateY(12px);
}

/* Animate child elements when slide becomes active (staggered) */
.hero-billboard-slide.active .hero-book-image {
    animation: fadeInUp 600ms ease-out 120ms both;
}

.hero-billboard-slide.active .hero-headline {
    animation: fadeInUp 550ms ease-out 180ms both;
}

.hero-billboard-slide.active .hero-subheadline {
    animation: fadeInUp 550ms ease-out 260ms both;
}

.hero-cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Optional: animate CTA group slightly later */
.hero-billboard-slide.active .hero-cta-group {
    animation: fadeInUp 500ms ease-out 340ms both;
}

/* ===================================
   LAYOUT MODES
   =================================== */
/* Left layout - book on left, text on right (default) */
.hero-layout-left .hero-content-wrapper {
    flex-direction: row;
}

.hero-layout-left .hero-text-section {
    text-align: left;
}

.hero-layout-left .hero-cta-group {
    justify-content: flex-start;
}

/* Right layout - book on right, text on left */
.hero-layout-right .hero-content-wrapper {
    flex-direction: row-reverse;
}

.hero-layout-right .hero-text-section {
    text-align: left;
}

.hero-layout-right .hero-cta-group {
    justify-content: flex-start;
}

.hero-layout-right .hero-billboard-overlay {
    /* No overlay gradient */
    background: none;
}

/* Center layout - book and text centered */
.hero-layout-center .hero-content-wrapper {
    flex-direction: column;
    text-align: center;
}

.hero-layout-center .hero-text-section {
    text-align: center;
}

.hero-layout-center .hero-cta-group {
    justify-content: center;
}

.hero-layout-center .hero-billboard-overlay {
    /* No overlay gradient */
    background: none;
}

/* ===================================
   CTA BUTTONS - Site Theme Style
   =================================== */
.hero-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff !important; /* Force white text */
}

/* Ensure visited links don't change color */
.hero-cta-btn:visited {
    color: #fff !important;
}

/* Primary button - Green (Start Free / Read Now) */
.hero-cta-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff !important;
}

.hero-cta-primary:hover {
    background: linear-gradient(135deg, #239139 0%, #1cb386 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-primary:visited {
    color: #fff !important;
}

/* Secondary button - Blue (Preview) */
.hero-cta-secondary {
    background: linear-gradient(135deg, #007bff 0%, #00b4ff 100%);
    color: #fff !important;
}

.hero-cta-secondary:hover {
    background: linear-gradient(135deg, #0069d9 0%, #009de6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-secondary:visited {
    color: #fff !important;
}

/* Audio button - Purple (Listen Now) */
.hero-cta-audio {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: #fff !important;
}

.hero-cta-audio:hover {
    background: linear-gradient(135deg, #5a32a3 0%, #4a2885 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.hero-cta-audio:visited {
    color: #fff !important;
}

.hero-cta-btn i {
    font-size: 1.1rem;
    color: inherit;
}

/* ===================================
   NAVIGATION INDICATORS - Progress Bar Style
   =================================== */
.hero-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 50;
}

.hero-indicator {
    position: relative;
    width: 2.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.hero-indicator.active {
    background: rgba(255, 255, 255, 0.25);
    width: 3.5rem;
}

/* Progress bar animation inside active indicator */
.hero-indicator-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--highlight-color, #f59e0b) 0%, #fbbf24 100%);
    transform-origin: left;
    /* Animation duration set via inline style from component to stay in sync with AutoplayIntervalMs */
    animation: progressBar linear forwards;
    border-radius: 2px;
}

@keyframes progressBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Pause indicator - shows when user hovers or presses ESC */
.hero-pause-indicator {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 60;
    animation: fadeInPause 0.3s ease-out;
}

.hero-pause-indicator i {
    font-size: 1.2rem;
}

@keyframes fadeInPause {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   NAVIGATION CONTROLS - Modern centered approach
   =================================== */
.hero-nav-controls {
    /* Remove old container - buttons are now positioned individually */
    display: contents;
}

.hero-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    /* Subtle shadow for depth */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-nav-prev {
    left: 2rem;
}

.hero-nav-next {
    right: 2rem;
}

.hero-nav-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.hero-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}

/* Hide on initial load, fade in after content loads */
.hero-nav-btn {
    opacity: 0;
    animation: fadeInNavBtn 0.4s ease-out 0.8s forwards;
}

@keyframes fadeInNavBtn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===================================
   EMPTY STATE
   =================================== */
.hero-billboard-empty {
    min-height: 50vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-billboard-empty .hero-billboard-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
}

.hero-empty-state {
    text-align: center;
    max-width: 600px;
}

.hero-empty-state p {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-empty-state .hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===================================
   SKELETON LOADING
   =================================== */
.hero-billboard-skeleton {
    opacity: 0;
    animation: fadeInHero 0.5s ease-out forwards;
}

.hero-billboard-skeleton .hero-billboard-background {
    background: linear-gradient(90deg, #f0f3f5 25%, #e2e8ec 50%, #f0f3f5 75%);
    background-size: 200% 100%;
    filter: none;
    animation: shimmerHero 1.5s ease-in-out infinite;
}

/* Fade in animation for hero billboard content */
.hero-billboard-slide.active {
    animation: fadeInHero 0.6s ease-out forwards;
}

@keyframes fadeInHero {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmerHero {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Staggered entrance animation */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Subtle background zoom for active slide */
@keyframes heroZoomSlow {
    0% { transform: scale(1.06); }
    100% { transform: scale(1.10); }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-billboard-slide { transition: none; }
    .hero-billboard-slide.active, .hero-billboard-skeleton { animation: none; }
    .hero-billboard-background { animation: none; }
    .hero-billboard-slide.active .hero-book-image,
    .hero-billboard-slide.active .hero-headline,
    .hero-billboard-slide.active .hero-subheadline,
    .hero-billboard-slide.active .hero-cta-group { animation: none; opacity: 1; transform: none; }
}

/* ===================================
   DARK MODE STYLES
   =================================== */
body.dark-mode .hero-indicator.active {
    background: #f59e0b;
}

body.dark-mode .hero-cta-primary {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    color: #fff !important;
}

body.dark-mode .hero-cta-primary:hover {
    background: linear-gradient(135deg, #1ea850 0%, #0e9f6e 100%);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    color: #fff !important;
}

body.dark-mode .hero-cta-primary:visited {
    color: #fff !important;
}

body.dark-mode .hero-cta-audio {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff !important;
}

body.dark-mode .hero-cta-audio:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    color: #fff !important;
}

body.dark-mode .hero-cta-audio:visited {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary:hover {
    color: #fff !important;
}

body.dark-mode .hero-cta-secondary:visited {
    color: #fff !important;
}

/* ===================================
   DARK MODE ADJUSTMENTS
   =================================== */
body.dark-mode .hero-billboard-overlay {
    /* Add back a subtle overlay in dark mode for text readability */
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.05) 100%);
}

body.dark-mode .hero-layout-center .hero-billboard-overlay {
    background: radial-gradient(circle at center,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.18) 55%,
        rgba(0, 0, 0, 0.05) 100%) !important;
}

body.dark-mode .hero-layout-right .hero-billboard-overlay {
    background: linear-gradient(270deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.30) 45%,
        rgba(0, 0, 0, 0.05) 100%) !important;
}

body.dark-mode .hero-billboard-background {
    filter: blur(30px) saturate(1.15) brightness(0.82);
}

body.dark-mode .hero-billboard-background.promo-background {
    filter: brightness(0.9) contrast(1.05);
}

body.dark-mode .hero-nav-btn {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.50);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.dark-mode .hero-nav-btn:hover {
    background: rgba(0, 0, 0, 0.50);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

body.dark-mode .hero-indicator {
    background: rgba(255, 255, 255, 0.25);
}

body.dark-mode .hero-indicator:hover {
    background: rgba(255, 255, 255, 0.40);
}

body.dark-mode .hero-indicator.active {
    background: rgba(255, 255, 255, 0.20);
}

body.dark-mode .hero-indicator-progress {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

body.dark-mode .hero-pause-indicator {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===================================
   RESPONSIVE STYLES - TABLET
   =================================== */
@media (max-width: 992px) {
    .hero-billboard {
        min-height: 60vh;
    }

    .hero-content-wrapper {
        padding: 2rem;
        gap: 2rem;
    }

    .hero-book-image {
        max-height: 40vh;
        max-width: 220px;
    }

    .hero-headline {
        font-size: 2.2rem;
    }

    /* Slightly smaller nav buttons on tablet */
    .hero-nav-btn {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.2rem;
    }

    .hero-nav-prev {
        left: 1.5rem;
    }

    .hero-nav-next {
        right: 1.5rem;
    }
}

/* ===================================
   RESPONSIVE STYLES - MOBILE
   Force centered layout on mobile
   =================================== */
@media (max-width: 768px) {
.hero-billboard {
    /* Optimize for mobile viewport - account for nav bar */
    min-height: calc(100vh - 70px);
    max-height: none;
}

    /* Force centered layout on mobile regardless of HeroLayoutMode */
    .hero-billboard-slide .hero-content-wrapper {
        flex-direction: column !important;
        text-align: center;
        padding: 2rem 1.5rem;
        padding-top: 100px; /* Reduced - new nav is edge-to-edge so needs less clearance */
        padding-bottom: 11rem; /* Increased to clear nav buttons + indicators */
        gap: 1.5rem;
    }

    .hero-billboard-slide .hero-text-section {
        text-align: center !important;
    }

    .hero-billboard-slide .hero-cta-group {
        justify-content: center !important;
        flex-direction: column;
        align-items: center;
    }

    .hero-billboard-slide .hero-billboard-overlay {
        /* No overlay gradient on mobile */
        background: none !important;
    }

    .hero-book-image {
        max-height: 35vh;
        max-width: 180px;
        transform: none;
    }

    .hero-book-image:hover {
        transform: scale(1.02);
    }

    .hero-headline {
        font-size: 1.6rem;
    }

    .hero-subheadline {
        font-size: 1rem;
    }

    .hero-cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.85rem 2rem;
    }

    .hero-indicators {
        bottom: 4rem;
    }

    /* Pause indicator on mobile - top right, smaller */
    .hero-pause-indicator {
        top: 1rem;
        right: 1rem;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-pause-indicator span {
        display: none; /* Hide text on mobile, keep icon */
    }

    /* Mobile nav buttons - larger tap targets, positioned in thumb zones */
    .hero-nav-btn {
        width: 3rem;
        height: 3rem;
        font-size: 1.15rem;
        /* Position lower for easier thumb reach */
        top: auto;
        bottom: 7rem;
        transform: none;
        /* Slight inset from edges */
        background: rgba(255, 255, 255, 0.18);
    }

    .hero-nav-prev {
        left: 1rem;
    }

    .hero-nav-next {
        right: 1rem;
    }

    .hero-nav-btn:hover {
        transform: scale(1.08);
    }

    .hero-nav-btn:active {
        transform: scale(0.96);
    }
}

/* ===================================
   RESPONSIVE STYLES - SMALL MOBILE
   =================================== */
@media (max-width: 480px) {
    .hero-billboard {
        min-height: 90vh;
    }

    .hero-billboard-slide .hero-content-wrapper {
        padding: 1.5rem 1rem;
        padding-top: 95px; /* Adjusted for edge-to-edge nav */
        padding-bottom: 10rem; /* Clear nav buttons + indicators */
    }

    .hero-book-image {
        max-height: 30vh;
        max-width: 150px;
    }

    .hero-headline {
        font-size: 1.4rem;
    }

    .hero-subheadline {
        font-size: 0.9rem;
    }

    .hero-cta-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .hero-indicators {
        bottom: 3.5rem;
        gap: 0.4rem;
    }

    .hero-indicator {
        width: 1.8rem;
    }

    .hero-indicator.active {
        width: 2.5rem;
    }

    /* Small mobile - maintain positioning consistency */
    .hero-nav-btn {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.05rem;
        bottom: 6.5rem;
    }

    .hero-nav-prev {
        left: 0.75rem;
    }

    .hero-nav-next {
        right: 0.75rem;
    }
}

    .hero-nav-btn {
        width: 2.2rem;
        height: 2.2rem;
    }
}

/* ===================================
   ULTRA-WIDE SCREENS
   =================================== */
@media (min-width: 1800px) {
    .hero-billboard {
        max-height: 90vh;
    }

    .hero-content-wrapper {
        max-width: 1600px;
    }

    .hero-book-image {
        max-height: 55vh;
        max-width: 320px;
    }

    .hero-headline {
        font-size: 3.2rem;
    }

    .hero-cta-btn {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
}
