/* ============================================================================
   Hero Banner Management System - Frontend Styles
   ============================================================================ */

/* Base Hero Banner Styles */
.hb-banner {
    position: relative;
    width: 100%;
    height: var(--hb-height-desktop);
    overflow: hidden;
    background: #f0f0f0;
    --hb-height-desktop: 400px;
    --hb-height-tablet: 350px;
    --hb-height-mobile: 300px;
    contain: layout style paint;
    /* Performance: CSS containment */
    will-change: height;
    /* Performance: Optimize for height changes */
}

.hb-banner-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
    font-size: 18px;
}

/* Image Banner */
.hb-banner-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Slideshow Banner */
.hb-banner-slideshow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hb-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.hb-slide.active {
    opacity: 1;
}

.hb-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Navigation Controls */
.hb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: background 0.3s;
    border-radius: 4px;
}

.hb-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.hb-nav:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.hb-nav:focus:not(:focus-visible) {
    outline: none;
}

.hb-nav-prev {
    left: 20px;
}

.hb-nav-next {
    right: 20px;
}

/* Pagination Dots */
.hb-pagination {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.hb-pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
    border: 2px solid transparent;
}

.hb-pagination-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.hb-pagination-dot:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.hb-pagination-dot:focus:not(:focus-visible) {
    outline: none;
}

.hb-pagination-dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Video Banner */
.hb-banner-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.hb-banner-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* Overlay Styles */
.hb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    /* Override inline width from PHP so the overlay always spans the full banner */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0 15px;
}

.hb-overlay-align-left {
    justify-content: flex-start;
}

.hb-overlay-align-left .hb-overlay-content {
    align-items: flex-start;
    text-align: left;
}

.hb-overlay-align-center {
    justify-content: center;
}

.hb-overlay-align-center .hb-overlay-content {
    align-items: center;
    text-align: center;
}

.hb-overlay-align-right {
    justify-content: flex-end;
}

.hb-overlay-align-right .hb-overlay-content {
    align-items: flex-end;
    text-align: right;
}

.hb-overlay-content {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Gradient Overlay Layer */
.hb-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* Overlay Typography */
.hb-overlay-heading {
    margin: 0 0 15px 0;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    color: inherit;
}

.hb-overlay-subheading {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.4;
    color: inherit;
}

.hb-overlay-body {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
}

/* CTA Button Styles */
.hb-cta-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.hb-cta-button:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.hb-cta-button:focus:not(:focus-visible) {
    outline: none;
}

.hb-cta-primary {
    background: #667eea;
    color: white;
}

.hb-cta-primary:hover {
    background: #764ba2;
    color: white;
}

.hb-cta-primary:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.hb-cta-secondary {
    background: #f0f0f0;
    color: #333;
}

.hb-cta-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.hb-cta-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.hb-cta-outline:hover {
    background: white;
    color: #333;
}

.hb-cta-ghost {
    background: transparent;
    color: white;
    text-decoration: underline;
}

.hb-cta-ghost:hover {
    opacity: 0.8;
}

/* Animations */
@keyframes hb-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes hb-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hb-slide-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hb-slide-left {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes hb-slide-right {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes hb-zoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hb-animate-fade {
    animation: hb-fade-in 0.8s ease-out;
}

.hb-animate-slide-up {
    animation: hb-slide-up 0.8s ease-out;
}

.hb-animate-slide-down {
    animation: hb-slide-down 0.8s ease-out;
}

.hb-animate-slide-left {
    animation: hb-slide-left 0.8s ease-out;
}

.hb-animate-slide-right {
    animation: hb-slide-right 0.8s ease-out;
}

.hb-animate-zoom {
    animation: hb-zoom 0.8s ease-out;
}

/* Transition Effects */
.hb-transition-fade .hb-slide {
    transition: opacity 0.5s ease-in-out;
}

.hb-transition-slide-left .hb-slide {
    transition: transform 0.5s ease-in-out;
}

.hb-transition-slide-left .hb-slide.active {
    transform: translateX(0);
}

.hb-transition-slide-left .hb-slide.prev {
    transform: translateX(-100%);
}

.hb-transition-slide-left .hb-slide.next {
    transform: translateX(100%);
}

/* Responsive Heights */
@media (max-width: 991px) {
    .hb-banner {
        height: var(--hb-height-tablet) !important;
    }
}

@media (max-width: 767px) {
    .hb-banner {
        height: var(--hb-height-mobile) !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hb-overlay-heading {
        font-size: 32px;
    }

    .hb-overlay-subheading {
        font-size: 18px;
    }

    .hb-overlay-body {
        font-size: 14px;
    }

    .hb-nav {
        padding: 10px 15px;
        font-size: 16px;
    }

    .hb-nav-prev {
        left: 10px;
    }

    .hb-nav-next {
        right: 10px;
    }

    /* Force center alignment on mobile for all hero banners */
    .hb-overlay {
        justify-content: center !important;
        padding: 0 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .hb-overlay-content {
        align-items: center !important;
        text-align: center !important;
        padding: 20px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .hb-overlay-align-left .hb-overlay-content,
    .hb-overlay-align-right .hb-overlay-content,
    .hb-overlay-align-center .hb-overlay-content {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Override any inline width on overlays - use multiple selectors for specificity */
    .hb-overlay[style],
    div.hb-overlay,
    .hb-banner .hb-overlay {
        width: 100% !important;
        max-width: 100% !important;
    }

}

@media (max-width: 480px) {
    .hb-overlay-heading {
        font-size: 24px;
    }

    .hb-overlay-subheading {
        font-size: 16px;
    }

    .hb-overlay-body {
        font-size: 13px;
    }

    .hb-cta-button {
        padding: 10px 20px;
        font-size: 14px;
    }

    .hb-nav {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Additional Transition Effects */

/* Zoom In Effect */
.hb-transition-zoom-in .hb-slide {
    transition: transform 0.5s ease-in-out;
}

.hb-transition-zoom-in .hb-slide.active {
    transform: scale(1);
}

.hb-transition-zoom-in .hb-slide.prev,
.hb-transition-zoom-in .hb-slide.next {
    transform: scale(0.8);
}

/* Zoom Out Effect */
.hb-transition-zoom-out .hb-slide {
    transition: transform 0.5s ease-in-out;
}

.hb-transition-zoom-out .hb-slide.active {
    transform: scale(1);
}

.hb-transition-zoom-out .hb-slide.prev,
.hb-transition-zoom-out .hb-slide.next {
    transform: scale(1.2);
}

/* Slide Up Effect */
.hb-transition-slide-up .hb-slide {
    transition: transform 0.5s ease-in-out;
}

.hb-transition-slide-up .hb-slide.active {
    transform: translateY(0);
}

.hb-transition-slide-up .hb-slide.prev {
    transform: translateY(-100%);
}

.hb-transition-slide-up .hb-slide.next {
    transform: translateY(100%);
}

/* Slide Down Effect */
.hb-transition-slide-down .hb-slide {
    transition: transform 0.5s ease-in-out;
}

.hb-transition-slide-down .hb-slide.active {
    transform: translateY(0);
}

.hb-transition-slide-down .hb-slide.prev {
    transform: translateY(100%);
}

.hb-transition-slide-down .hb-slide.next {
    transform: translateY(-100%);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .hb-slide,
    .hb-nav,
    .hb-pagination-dot,
    .hb-cta-button,
    .hb-overlay {
        transition: none !important;
        animation: none !important;
    }
}