/**
 * Hero Component
 * 
 * Flexible hero section supporting multiple styles and animations
 */

/* ==========================================================================
   Base Hero Structure
   ========================================================================== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--text-color);
    color: var(--color-text-inverse, white);
}

/* Content wrapper */
.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--container-padding);
    text-align: center;
}

/* ==========================================================================
   Hero Backgrounds
   ========================================================================== */

/* Background Image */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Desktop parallax effect */
@media (min-width: 769px) {
    .hero-parallax .hero-bg-image {
        background-attachment: fixed;
    }
}

/* Background Overlay */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay, rgba(0, 0, 0, 0.5));
    z-index: 1;
}

/* Gradient Background */
.hero-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ==========================================================================
   Hero Styles
   ========================================================================== */

/* Style: Image with Overlay */
.hero-style-image {
    color: var(--color-text-inverse, white);
}

.hero-style-image .hero-overlay {
    background-color: var(--color-overlay, rgba(0, 0, 0, 0.4));
}

/* Style: Gradient */
.hero-style-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.hero-style-gradient .hero-bg-image {
    opacity: 0.3;
}

/* Style: Modern/Minimal */
.hero-style-modern {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
}

.hero-style-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.02) 35px, rgba(255,255,255,.02) 70px);
    pointer-events: none;
}

/* Hero Modern Section (used in template-parts/hero-modern.php) */
.hero-modern {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    overflow: hidden;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,.02) 35px, rgba(255,255,255,.02) 70px);
    pointer-events: none;
    z-index: 1;
}

/* Hero Modern specific background elements */
.hero-modern .hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero-modern .hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.8) 0%, rgba(26, 26, 46, 0.8) 100%);
    z-index: 1;
}

.hero-modern .hero-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    background: radial-gradient(ellipse at top left, #16a085 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, #e74c3c 0%, transparent 50%);
    filter: blur(100px);
    animation: gradientShift 20s ease-in-out infinite;
    z-index: 0;
}

/* Hero Modern Content */
.hero-content-modern {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

.hero-content-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-text-section {
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.hero-title-modern {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    color: white;
}

.hero-title-gradient {
    background: linear-gradient(135deg, #16a085 0%, #e74c3c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-2xl);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hero Modern Buttons */
.hero-cta-group {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-btn-primary,
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-2xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
}

.hero-btn-primary {
    background: var(--primary-color);
    color: white;
}

.hero-btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Hero Modern Visual Section */
.hero-visual-section {
    position: relative;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.hero-featured-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Geometric Accent */
.hero-geometric-accent {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.geometric-shape {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.geometric-shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    right: -150px;
    animation-delay: 0s;
}

.geometric-shape:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: -100px;
    animation-delay: 5s;
}

.geometric-shape:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 10%;
    animation-delay: 10s;
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-mouse {
    width: 25px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
}

.scroll-wheel {
    width: 3px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

/* Style: Video Background */
.hero-style-video {
    background: #000;
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    z-index: 0;
}

/* ==========================================================================
   Hero Content
   ========================================================================== */

/* Text Container */
.hero-text-section {
    max-width: 800px;
    margin: 0 auto;
}

/* Title */
.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    color: inherit;
}

/* Subtitle */
.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 400;
    margin-bottom: var(--space-lg);
    opacity: 0.9;
    color: inherit;
}

/* Description */
.hero-description {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
    margin-bottom: var(--space-2xl);
    opacity: 0.85;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: inherit;
}

/* CTA Buttons */
.hero-cta-group {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta-primary,
.hero-cta-secondary {
    display: inline-flex;
    align-items: center;
    padding: var(--space-md) var(--space-2xl);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.hero-cta-primary {
    background-color: var(--primary-color);
    color: white;
}

.hero-cta-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-cta-secondary {
    background-color: transparent;
    color: inherit;
    border: 2px solid currentColor;
}

.hero-cta-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ==========================================================================
   Hero Features
   ========================================================================== */

/* Feature List */
.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-3xl);
}

.hero-feature {
    text-align: center;
}

.hero-feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 1.5rem;
}

.hero-feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.hero-feature-text {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-3xl);
    padding-top: var(--space-3xl);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stat {
    text-align: center;
}

.hero-stat-number {
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.hero-stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* ==========================================================================
   Decorative Elements
   ========================================================================== */

/* Animated Background Elements */
.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

/* Floating shapes */
.floating-shape {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* Gradient animation */
.animated-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    background: radial-gradient(ellipse at top left, var(--primary-color) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, var(--accent-color) 0%, transparent 50%);
    filter: blur(100px);
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
    }
    33% { 
        transform: translate(-30px, -30px) scale(1.1); 
    }
    66% { 
        transform: translate(30px, -30px) scale(0.9); 
    }
}

/* ==========================================================================
   Page-Specific Heroes
   ========================================================================== */

/* Service Hero */
.service-hero {
    min-height: 70vh;
}

.service-hero .hero-content {
    text-align: left;
}

.service-hero .hero-features {
    margin-top: var(--space-2xl);
    text-align: left;
}

/* Work/Portfolio Hero */
.work-hero {
    min-height: 60vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.work-hero .hero-description,
.work-hero .hero-stats {
    opacity: 1;
    animation: none;
}

/* About Hero */
.about-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* Blog Hero */
.blog-hero {
    min-height: 50vh;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

/* ==========================================================================
   Animations
   ========================================================================== */

/* Fade in animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate .hero-title {
    animation: fadeInUp 0.8s ease-out;
}

.hero-animate .hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-animate .hero-description {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-animate .hero-cta-group {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-animate .hero-features {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .hero-section {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .hero-content {
        padding: var(--space-lg) var(--space-md);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta-group {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .hero-cta-primary,
    .hero-cta-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        margin-top: var(--space-2xl);
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    /* Disable complex animations on mobile */
    .animated-gradient,
    .floating-shape {
        animation: none;
    }
    
    /* Service hero mobile */
    .service-hero .hero-content {
        text-align: center;
    }
    
    .service-hero .hero-features {
        text-align: center;
    }
    
    /* Hero Modern mobile */
    .hero-modern {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .hero-content-modern {
        padding: 0 var(--space-md);
    }
    
    .hero-content-inner {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
        text-align: center;
    }
    
    .hero-title-modern {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta-group {
        justify-content: center;
    }
    
    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .geometric-shape {
        display: none;
    }
    
    .hero-visual-section {
        display: none;
    }
    
    .hero-scroll-indicator {
        bottom: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-content {
        padding: var(--space-xl) var(--space-lg);
    }
    
    .hero-features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero Modern tablet */
    .hero-content-modern {
        padding: 0 var(--space-lg);
    }
    
    .hero-content-inner {
        gap: var(--space-3xl);
    }
    
    .hero-title-modern {
        font-size: 3rem;
    }
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-animate .hero-title,
    .hero-animate .hero-subtitle,
    .hero-animate .hero-description,
    .hero-animate .hero-cta-group,
    .hero-animate .hero-features,
    .floating-shape,
    .animated-gradient {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hero-overlay {
        background-color: rgba(0, 0, 0, 0.7);
    }
    
    .hero-description {
        opacity: 1;
    }
}

/* ==========================================================================
   Specific Hero Description Styling Override
   ========================================================================== */

/* Ensure hero description is visible on dark backgrounds */
.hero-section .hero-description,
.hero-content .hero-description,
.hero-content-modern .hero-description,
.hero-modern .hero-description {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}