/**
 * Hero Section Stylesheet
 * Modern, professional hero section with carousel support
 *
 * @package GodzillaNutrition_Theme
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
    --hero-height-desktop: 600px;
    --hero-height-mobile: 400px;
    --hero-dot-size: 12px;
    --hero-dot-size-active: 14px;
    --hero-dot-spacing: 10px;
    --hero-dot-inactive-color: rgba(255, 255, 255, 0.5);
    --hero-dot-active-color: var(--primary-color, #ff6b6b);
    --hero-transition-duration: 0.6s;
    --hero-nav-size: 48px;
}

/* ==========================================================================
   Hero Section Container
   ========================================================================== */

.hero-section {
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.hero-section.hero-carousel-mode,
.hero-section.hero-single-mode {
    min-height: auto;
}

/* ==========================================================================
   Carousel Container
   ========================================================================== */

#heroCarousel {
    position: relative;
    width: 100%;
}

#heroCarousel .carousel-inner {
    width: 100%;
    overflow: hidden;
}

#heroCarousel .carousel-item {
    position: relative;
    width: 100%;
    transition: opacity var(--hero-transition-duration) ease-in-out;
}

/* Ensure carousel-fade works properly */
#heroCarousel.carousel-fade .carousel-item {
    opacity: 0;
    transition-property: opacity;
    transform: none;
}

#heroCarousel.carousel-fade .carousel-item.active,
#heroCarousel.carousel-fade .carousel-item-next.carousel-item-start,
#heroCarousel.carousel-fade .carousel-item-prev.carousel-item-end {
    opacity: 1;
}

#heroCarousel.carousel-fade .active.carousel-item-start,
#heroCarousel.carousel-fade .active.carousel-item-end {
    opacity: 0;
}

/* ==========================================================================
   Hero Slide
   ========================================================================== */

.hero-slide {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
}

.hero-slide-link {
    display: block;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
}

.hero-slide-link:hover {
    text-decoration: none;
}

/* ==========================================================================
   Hero Image
   ========================================================================== */

.hero-image {
    width: 100%;
    height: auto;
    max-height: var(--hero-height-desktop);
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

/* Subtle zoom effect on hover for clickable slides */
.hero-slide-link:hover .hero-image {
    transform: scale(1.02);
}

/* Single slide specific styles */
.hero-single {
    position: relative;
    width: 100%;
}

.hero-single .hero-slide {
    width: 100%;
}

/* ==========================================================================
   Modern Dot Indicators
   ========================================================================== */

.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--hero-dot-spacing);
    z-index: 10;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 30px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-dot {
    width: var(--hero-dot-size);
    height: var(--hero-dot-size);
    border-radius: 50%;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background-color: var(--hero-dot-inactive-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.15);
}

.hero-dot:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.hero-dot.active {
    width: var(--hero-dot-size-active);
    height: var(--hero-dot-size-active);
    background-color: var(--dot-active-color, var(--hero-dot-active-color));
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                0 0 12px rgba(var(--primary-rgb, 255, 107, 107), 0.5);
}

/* Pulse animation for active dot */
.hero-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--hero-dot-size-active) + 8px);
    height: calc(var(--hero-dot-size-active) + 8px);
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--dot-active-color, var(--hero-dot-active-color));
    opacity: 0;
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* ==========================================================================
   Navigation Arrows - Modern Design
   ========================================================================== */

/* Completely override Bootstrap carousel controls for hero section only */
#heroCarousel .carousel-control-prev,
#heroCarousel .carousel-control-next {
    width: auto !important;
    height: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    z-index: 10 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: transparent !important;
    text-decoration: none !important;
}

/* Show on hero section hover */
.hero-section:hover #heroCarousel .carousel-control-prev,
.hero-section:hover #heroCarousel .carousel-control-next {
    opacity: 1;
    visibility: visible;
}

/* Modern arrow button design */
#heroCarousel .carousel-control-prev.hero-nav-btn,
#heroCarousel .carousel-control-next.hero-nav-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Remove Bootstrap default icons */
#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon {
    display: none !important;
    width: 0;
    height: 0;
    background: none;
}

/* Custom icon styling */
#heroCarousel .hero-nav-icon {
    font-size: 1.5rem;
    color: #2d3436;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover effects */
#heroCarousel .carousel-control-prev.hero-nav-btn:hover,
#heroCarousel .carousel-control-next.hero-nav-btn:hover {
    background: var(--primary-color, #ff6b6b);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2),
                0 0 0 4px rgba(var(--primary-rgb, 255, 107, 107), 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

#heroCarousel .carousel-control-prev.hero-nav-btn:hover .hero-nav-icon,
#heroCarousel .carousel-control-next.hero-nav-btn:hover .hero-nav-icon {
    color: #ffffff;
    transform: scale(1.1);
}

/* Active/pressed state */
#heroCarousel .carousel-control-prev.hero-nav-btn:active,
#heroCarousel .carousel-control-next.hero-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Position controls */
#heroCarousel .carousel-control-prev.hero-nav-btn {
    left: 24px;
}

#heroCarousel .carousel-control-next.hero-nav-btn {
    right: 24px;
}

/* RTL Support for Navigation */
[dir="rtl"] #heroCarousel .carousel-control-prev.hero-nav-btn {
    left: auto;
    right: 24px;
}

[dir="rtl"] #heroCarousel .carousel-control-next.hero-nav-btn {
    right: auto;
    left: 24px;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet */
@media (max-width: 991.98px) {
    :root {
        --hero-height-desktop: 500px;
        --hero-nav-size: 50px;
    }
    
    .hero-indicators {
        bottom: 15px;
        padding: 8px 16px;
    }
    
    #heroCarousel .carousel-control-prev.hero-nav-btn,
    #heroCarousel .carousel-control-next.hero-nav-btn {
        width: 50px;
        height: 50px;
    }
    
    #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: 18px;
    }
    
    #heroCarousel .carousel-control-next.hero-nav-btn {
        right: 18px;
    }
    
    #heroCarousel .hero-nav-icon {
        font-size: 1.35rem;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: auto;
        right: 18px;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-next.hero-nav-btn {
        right: auto;
        left: 18px;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    :root {
        --hero-height-desktop: var(--hero-height-mobile);
        --hero-dot-size: 10px;
        --hero-dot-size-active: 12px;
        --hero-dot-spacing: 8px;
        --hero-nav-size: 44px;
    }
    
    .hero-image {
        max-height: var(--hero-height-mobile);
    }
    
    .hero-indicators {
        bottom: 12px;
        padding: 6px 12px;
        gap: 8px;
    }
    
    /* Always show nav buttons on mobile for touch users */
    #heroCarousel .carousel-control-prev.hero-nav-btn,
    #heroCarousel .carousel-control-next.hero-nav-btn {
        opacity: 0.85;
        visibility: visible;
        width: 44px;
        height: 44px;
    }
    
    #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: 12px;
    }
    
    #heroCarousel .carousel-control-next.hero-nav-btn {
        right: 12px;
    }
    
    #heroCarousel .hero-nav-icon {
        font-size: 1.2rem;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: auto;
        right: 12px;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-next.hero-nav-btn {
        right: auto;
        left: 12px;
    }
    
    /* Disable pulse animation on mobile for performance */
    .hero-dot.active::after {
        animation: none;
        display: none;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --hero-height-mobile: 350px;
        --hero-nav-size: 40px;
    }
    
    .hero-image {
        max-height: 350px;
    }
    
    .hero-indicators {
        bottom: 10px;
        padding: 5px 10px;
    }
    
    #heroCarousel .carousel-control-prev.hero-nav-btn,
    #heroCarousel .carousel-control-next.hero-nav-btn {
        width: 40px;
        height: 40px;
        left: 10px;
        right: 10px;
    }
    
    #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: 10px;
    }
    
    #heroCarousel .carousel-control-next.hero-nav-btn {
        right: 10px;
    }
    
    #heroCarousel .hero-nav-icon {
        font-size: 1.1rem;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-prev.hero-nav-btn {
        left: auto;
        right: 10px;
    }
    
    [dir="rtl"] #heroCarousel .carousel-control-next.hero-nav-btn {
        right: auto;
        left: 10px;
    }
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.hero-slide.loading .hero-image {
    opacity: 0;
}

.hero-slide .hero-image {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .hero-dot,
    .hero-dot.active::after,
    .hero-nav-btn,
    .hero-image,
    #heroCarousel .carousel-item {
        transition: none;
        animation: none;
    }
    
    .hero-dot.active::after {
        display: none;
    }
}

/* Focus visible for keyboard navigation */
.hero-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

#heroCarousel .carousel-control-prev.hero-nav-btn:focus-visible,
#heroCarousel .carousel-control-next.hero-nav-btn:focus-visible {
    outline: 2px solid var(--primary-color, #ff6b6b);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(var(--primary-rgb, 255, 107, 107), 0.2);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .hero-section {
        display: none;
    }
}
