/**
 * Hero Section 2025 Premium - Ultimes Griots
 *
 * Modern hero section with:
 * - Typography XXL (4-5x larger than standard)
 * - Gradient text effects
 * - Parallax layers (GSAP compatible)
 * - Glassmorphism elements
 * - Scroll hint indicator
 * - Dark mode support
 * - Performance optimized
 *
 * @package madara
 * @version 4.0.0 - Premium Refonte Totale 2025
 * @author Ultimes Griots Design Team
 */

/* ============================================================================
   HERO SECTION BASE
   ============================================================================ */

.hero-2025-premium {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);

    /* FIX: Remonter le hero pour coller au header (pas d'espace blanc) */
    margin-top: calc(-1 * var(--header-height));
    padding-top: var(--header-height); /* Compenser pour le contenu */
}

/* Container for hero content */
.hero-content-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.hero-content-wrapper .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================================
   BACKGROUND LAYERS (Parallax Ready)
   ============================================================================ */

.hero-bg-layers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

/* Layer 1: Animated Gradient Background */
.hero-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.gradient-animated {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        var(--color-earth-clay) 0%,
        var(--color-earth-terracotta) 25%,
        var(--color-earth-mahogany) 60%,
        var(--color-neutral-darkest) 100%
    );
    animation: gradientShiftHero 30s ease-in-out infinite;
}

/* Dark mode gradient */
[data-theme="dark"] .gradient-animated {
    background: linear-gradient(
        135deg,
        #0a0a0a 0%,
        #1a1a1a 40%,
        #2d1b1b 70%,
        #1a1a1a 100%
    );
}

@keyframes gradientShiftHero {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        filter: hue-rotate(5deg) brightness(1.05);
    }
    50% {
        filter: hue-rotate(10deg) brightness(1.1);
    }
    75% {
        filter: hue-rotate(5deg) brightness(1.05);
    }
}

/* Layer 2: African Geometric Patterns */
.hero-bg-patterns {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
    color: var(--color-gold-primary);
}

.pattern-geo {
    position: absolute;
    width: clamp(60px, 8vw, 120px);
    height: clamp(60px, 8vw, 120px);
    will-change: transform;
}

/* Triangle patterns */
.pattern-triangle-1 {
    top: 10%;
    left: 8%;
    animation: floatPattern 18s ease-in-out infinite;
}

.pattern-triangle-2 {
    bottom: 20%;
    right: 12%;
    animation: floatPattern 22s ease-in-out infinite 5s;
}

/* Circle patterns */
.pattern-circle-1 {
    top: 25%;
    right: 15%;
    animation: rotatePattern 30s linear infinite, floatPattern 20s ease-in-out infinite;
}

/* Diamond patterns */
.pattern-diamond-1 {
    bottom: 15%;
    left: 10%;
    animation: floatPattern 25s ease-in-out infinite 3s;
}

.pattern-diamond-2 {
    top: 35%;
    left: 20%;
    animation: floatPattern 28s ease-in-out infinite 7s;
}

@keyframes floatPattern {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.1;
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.05);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-10px) translateX(20px) scale(1);
        opacity: 0.12;
    }
    75% {
        transform: translateY(-30px) translateX(5px) scale(0.95);
        opacity: 0.08;
    }
}

@keyframes rotatePattern {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Layer 3: Cultural Particles */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    pointer-events: none;
    color: var(--color-gold-light);
}

.particle-star {
    position: absolute;
    font-size: clamp(16px, 2vw, 28px);
    opacity: 0.4;
    animation: particleFloat 8s ease-in-out infinite;
}

.particle-1 { top: 15%; left: 25%; animation-delay: 0s; }
.particle-2 { top: 40%; right: 20%; animation-delay: 1s; }
.particle-3 { bottom: 30%; left: 15%; animation-delay: 2s; }
.particle-4 { top: 60%; right: 35%; animation-delay: 3s; }
.particle-5 { top: 20%; right: 45%; animation-delay: 4s; }
.particle-6 { bottom: 45%; left: 40%; animation-delay: 5s; }
.particle-7 { top: 70%; left: 30%; animation-delay: 6s; }
.particle-8 { bottom: 20%; right: 25%; animation-delay: 7s; }

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) scale(1.2);
        opacity: 0.6;
    }
}

/* ============================================================================
   DECORATIVE ELEMENTS (Parallax Ready)
   ============================================================================ */

/* Baobab SVG */
.hero-baobab {
    position: absolute;
    right: -50px;
    bottom: 0;
    width: 200px;
    height: 400px;
    z-index: 4;
    opacity: 0.4;
    pointer-events: none;
}

.hero-baobab svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(212, 175, 55, 0.2));
}

/* Character Image */
.hero-character {
    position: absolute;
    left: 5%;
    bottom: 0;
    width: clamp(300px, 30vw, 500px);
    height: auto;
    z-index: 5;
    pointer-events: none;
}

.character-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.character-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    animation: characterPulse 6s ease-in-out infinite;
}

@keyframes characterPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.character-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, var(--color-gold-primary) 0%, transparent 70%);
    opacity: 0.2;
    filter: blur(40px);
    animation: glowPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Floating Books */
.hero-floating-books {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    pointer-events: none;
}

.book-float {
    position: absolute;
    width: clamp(40px, 5vw, 80px);
    height: clamp(50px, 6vw, 100px);
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.book-1 {
    top: 20%;
    right: 25%;
    animation: bookFloat 12s ease-in-out infinite;
}

.book-2 {
    top: 50%;
    right: 10%;
    animation: bookFloat 15s ease-in-out infinite 3s;
}

.book-3 {
    bottom: 30%;
    right: 35%;
    animation: bookFloat 18s ease-in-out infinite 6s;
}

@keyframes bookFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-40px) rotate(5deg);
    }
}

/* ============================================================================
   HERO CONTENT - TYPOGRAPHY XXL
   ============================================================================ */

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-8);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-md);
    animation: badgeFadeIn 0.8s var(--ease-out) 0.2s both;
}

.badge-icon {
    width: 18px;
    height: 18px;
    color: var(--color-gold-primary);
    animation: starRotate 3s linear infinite;
}

@keyframes starRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title XXL - 4-5x Larger */
.hero-title-xxl {
    font-size: clamp(3.5rem, 10vw, 8rem);  /* 56px → 128px (XXL!) */
    font-weight: var(--font-weight-black);  /* 900 weight */
    line-height: var(--line-height-tight);  /* 1.2 */
    letter-spacing: var(--letter-spacing-tighter);  /* -0.05em */
    margin: 0 0 var(--space-6);
    animation: titleFadeIn 1s var(--ease-out) 0.4s both;
}

.title-gradient {
    /* Fallback color for browsers that don't support background-clip: text */
    color: var(--color-gold-primary);

    /* Display required for background-clip to work */
    display: inline-block;

    /* Background gradient */
    background: linear-gradient(
        135deg,
        var(--color-gold-primary) 0%,
        var(--color-gold-light) 40%,
        var(--color-gold-vibrant) 60%,
        var(--color-gold-primary) 100%
    );
    background-size: 200% 200%;

    /* IMPORTANT: Webkit prefix MUST come first! */
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;

    /* Standard property (for future browsers) */
    background-clip: text !important;

    /* Make text transparent so gradient shows through */
    color: transparent;

    /* Animations */
    animation: gradientTextShift 8s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.3));
}

/* Dark mode: brighter gradient */
[data-theme="dark"] .title-gradient {
    background: linear-gradient(
        135deg,
        var(--color-gold-light) 0%,
        var(--color-gold-vibrant) 40%,
        #FFE55C 60%,
        var(--color-gold-light) 100%
    );
    background-size: 200% 200%;
}

@keyframes gradientTextShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Subtitle Large */
.hero-subtitle-large {
    font-size: clamp(1.5rem, 4vw, 3rem);  /* 24px → 48px (Large!) */
    font-weight: var(--font-weight-semibold);  /* 600 */
    line-height: var(--line-height-snug);  /* 1.375 */
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-6);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    animation: subtitleFadeIn 1s var(--ease-out) 0.6s both;
}

@keyframes subtitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Description Modern */
.hero-description-modern {
    font-size: clamp(1.125rem, 2vw, 1.375rem);  /* 18px → 22px */
    font-weight: var(--font-weight-normal);  /* 400 */
    line-height: var(--line-height-relaxed);  /* 1.625 */
    color: var(--color-text-tertiary);
    margin: 0 0 var(--space-10);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: descFadeIn 1s var(--ease-out) 0.8s both;
}

@keyframes descFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   CTA BUTTONS - GRADIENT & GLASSMORPHISM
   ============================================================================ */

.hero-cta-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-10);
    animation: ctaFadeIn 1s var(--ease-out) 1s both;
}

@keyframes ctaFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-md);  /* 18px */
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.cta-btn:active {
    transform: translateY(0);
}

.cta-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cta-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.cta-btn:hover .cta-arrow {
    transform: translateX(4px);
}

/* Primary CTA - Animated Gradient */
.cta-primary-gradient {
    background: linear-gradient(
        135deg,
        var(--color-gold-primary) 0%,
        var(--color-gold-light) 50%,
        var(--color-gold-primary) 100%
    );
    background-size: 200% 200%;
    color: var(--color-white);
    border: none;
    animation: gradientBgShift 3s ease-in-out infinite;
}

.cta-primary-gradient:hover {
    box-shadow: var(--shadow-glow-lg), var(--shadow-xl);
}

@keyframes gradientBgShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Secondary CTA - Glassmorphism */
.cta-secondary-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    color: var(--color-text-primary);
    border: 2px solid var(--glass-border);
}

.cta-secondary-glass:hover {
    background: var(--glass-bg-elevated);
    border-color: var(--color-gold-primary);
    color: var(--color-gold-primary);
}

/* ============================================================================
   TRUST STATS (Animated Counters)
   ============================================================================ */

.hero-trust-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    animation: statsFadeIn 1s var(--ease-out) 1.2s both;
}

@keyframes statsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.stat-icon {
    width: 16px;
    height: 16px;
    color: var(--color-gold-primary);
}

.stat-separator {
    color: var(--color-text-tertiary);
    opacity: 0.5;
}

.counter {
    font-weight: var(--font-weight-bold);
    color: var(--color-gold-primary);
}

/* ============================================================================
   SCROLL HINT INDICATOR
   ============================================================================ */

.scroll-hint {
    position: absolute;
    bottom: var(--space-10);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    z-index: 20;
    opacity: 0.7;
    transition: opacity var(--transition-normal);
    animation: hintFadeIn 1s var(--ease-out) 1.5s both;
}

.scroll-hint:hover {
    opacity: 1;
}

@keyframes hintFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 0.7;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mouse with scroll wheel */
.scroll-hint-mouse {
    width: 28px;
    height: 44px;
    border: 2px solid var(--color-text-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    opacity: 0.6;
}

.scroll-hint-wheel {
    width: 4px;
    height: 10px;
    background: var(--color-gold-primary);
    border-radius: var(--radius-full);
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: wheelScroll 2s ease-in-out infinite;
}

@keyframes wheelScroll {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

.scroll-hint-text {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
    margin: 0;
}

.scroll-hint-arrow {
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    animation: arrowBounce 2s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* Hide scroll hint after scrolling */
.scrolled .scroll-hint {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Large Desktop */
@media (min-width: 1920px) {
    .hero-title-xxl {
        font-size: clamp(6rem, 10vw, 10rem);  /* Even bigger on huge screens! */
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .hero-content-wrapper {
        padding: var(--space-10) var(--space-5);
    }

    .hero-character {
        width: clamp(250px, 25vw, 400px);
        left: 2%;
    }

    .hero-baobab {
        right: -80px;
        width: 150px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* FIX: Ajuster margin/padding pour header mobile (64px vs 90px) */
    .hero-2025-premium {
        margin-top: calc(-1 * var(--header-height-mobile));
        padding-top: var(--header-height-mobile);
    }

    .hero-content-wrapper {
        padding: var(--space-8) var(--space-4);
    }

    .hero-badge {
        font-size: var(--font-size-xs);
        padding: var(--space-2) var(--space-4);
    }

    .hero-title-xxl {
        font-size: clamp(2.5rem, 12vw, 4rem);  /* 40px → 64px on mobile */
        margin-bottom: var(--space-4);
    }

    .hero-subtitle-large {
        font-size: clamp(1.125rem, 5vw, 1.75rem);  /* 18px → 28px */
        margin-bottom: var(--space-4);
    }

    .hero-description-modern {
        font-size: clamp(1rem, 4vw, 1.125rem);  /* 16px → 18px */
        margin-bottom: var(--space-8);
    }

    .hero-cta-modern {
        flex-direction: column;
        gap: var(--space-3);
        width: 100%;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-size-base);
    }

    .hero-trust-stats {
        flex-direction: column;
        gap: var(--space-3);
        font-size: var(--font-size-xs);
    }

    .stat-separator {
        display: none;
    }

    /* Hide or reduce decorative elements on mobile */
    .hero-character {
        width: 200px;
        left: -30px;
        opacity: 0.5;
    }

    .hero-baobab {
        display: none;
    }

    .hero-floating-books {
        opacity: 0.3;
    }

    .pattern-geo {
        width: 50px;
        height: 50px;
        opacity: 0.5;
    }

    .scroll-hint {
        bottom: var(--space-6);
        transform: translateX(-50%) scale(0.9);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-title-xxl {
        font-size: clamp(2rem, 14vw, 3rem);  /* 32px → 48px */
    }

    .hero-character {
        width: 150px;
        left: -50px;
        opacity: 0.3;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .hero-bg-layers,
    .hero-character,
    .hero-baobab,
    .hero-floating-books,
    .scroll-hint {
        display: none !important;
    }

    .hero-2025-premium {
        min-height: auto;
        page-break-after: always;
    }
}

/* ============================================================================
   PERFORMANCE & GPU ACCELERATION
   ============================================================================ */

.hero-bg-gradient,
.pattern-geo,
.particle-star,
.character-img,
.book-float,
.title-gradient,
.cta-btn {
    will-change: transform;
}

/* Remove will-change after animations complete */
.hero-2025-premium.loaded .hero-bg-gradient,
.hero-2025-premium.loaded .pattern-geo,
.hero-2025-premium.loaded .particle-star {
    will-change: auto;
}

/* ============================================================================
   FALLBACK FOR BROWSERS NOT SUPPORTING BACKGROUND-CLIP: TEXT
   ============================================================================ */

@supports not (-webkit-background-clip: text) {
    .title-gradient {
        color: var(--color-gold-primary) !important;
        background: none !important;
        -webkit-text-fill-color: var(--color-gold-primary) !important;
    }

    [data-theme="dark"] .title-gradient {
        color: var(--color-gold-light) !important;
        -webkit-text-fill-color: var(--color-gold-light) !important;
    }
}
