/* 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;
}

/* ===================================
   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;
    /* Remove keyframe animation to avoid conflicts with transition */
    animation: none !important;
}

/* 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);
}

/* Primary button - Green (Start Free) */
.hero-cta-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.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;
    text-decoration: none;
}

/* Secondary button - Blue (Preview) */
.hero-cta-secondary {
    background: linear-gradient(135deg, #007bff 0%, #00b4ff 100%);
    color: #fff;
}

.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;
    text-decoration: none;
}

.hero-cta-btn i {
    font-size: 1.1rem;
}

/* ===================================
   NAVIGATION INDICATORS
   =================================== */
.hero-indicators {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 10;
}

.hero-indicator {
    width: 2.5rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
}

.hero-indicator.active {
    background: var(--highlight-color, #00b4ff);
    width: 3.5rem;
}

/* ===================================
   NAVIGATION CONTROLS
   =================================== */
.hero-nav-controls {
    position: absolute;
    bottom: 2rem;
    right: 3rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.hero-nav-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

.hero-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.hero-nav-btn:active {
    transform: scale(0.95);
}

/* ===================================
   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%);
}

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);
}

/* ===================================
   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;
    }
    
    .hero-nav-controls {
        right: 2rem;
    }
}

/* ===================================
   RESPONSIVE STYLES - MOBILE
   Force centered layout on mobile
   =================================== */
@media (max-width: 768px) {
    .hero-billboard {
        min-height: 85vh;
        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: 120px; /* Add extra top padding to clear the nav */
        padding-bottom: 8rem;
        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;
    }
    
    .hero-nav-controls {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .hero-nav-btn {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* ===================================
   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: 110px; /* Add extra top padding to clear the nav */
        padding-bottom: 7rem;
    }
    
    .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;
    }
    
    .hero-nav-controls {
        right: 1rem;
        bottom: 1rem;
    }
    
    .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;
    }
}
