// Breakpoints
$breakpoint-tablet: 992px;
$breakpoint-mobile: 768px;
$breakpoint-small-mobile: 480px;

// Hero Section
.hero-section {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 500px;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    align-items: center;

    // Hero Background
    .hero-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;

        @media (max-width: $breakpoint-mobile) {
            height: 100%;
            // margin-top: 80px;
        }

        .hero-picture {
            display: block;
            width: 100%;
            height: 100%;

            .hero-image {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: center;
            }
        }

        .hero-video,
        .hero-mp4-video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;

            // Video Controls - Ensure they don't overlap content
            &::-webkit-media-controls {
                display: none !important;
            }

            &::-webkit-media-controls-enclosure {
                display: none !important;
            }
        }

        .hero-vimeo-video,
        .hero-youtube-video {
            // Absolute centering trick to maintain 16:9 ratio and fully cover the parent
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100vw !important;
            height: 56.25vw !important;
            min-width: 177.77vh !important;
            min-height: 100vh !important;
            pointer-events: none;
            border: none;
        }

        // Dark Overlay
        .hero-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(to right, $hero-overlay-start 0%, $hero-overlay-middle 50%, $hero-overlay-end 100%);
            z-index: 2;

            @media (max-width: $breakpoint-mobile) {
                background: linear-gradient(to bottom, $hero-overlay-mobile-start 0%, $hero-overlay-mobile-end 100%);
            }
        }
    }

    // Hero Content
    .hero-content {
        position: relative;
        z-index: 3;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 40px;

        // Hero Text
        .hero-text {
            color: $hero-text-color;

            .hero-title {
                font-size: 56px;
                font-weight: 700;
                color: $hero-text-color;
                margin: 0 0 16px 0;
                line-height: 1.1;
                text-shadow: 2px 2px 8px $hero-text-shadow;

                @media (max-width: $breakpoint-tablet) {
                    font-size: 42px;
                }

                @media (max-width: $breakpoint-mobile) {
                    font-size: 32px;
                    margin-bottom: 0px;
                }

                @media (max-width: $breakpoint-small-mobile) {
                    font-size: 28px;
                }
            }

            .hero-subtitle {
                font-size: 24px;
                font-weight: 400;
                color: $hero-text-color;
                margin: 0 0 8px 0;
                line-height: 1.4;
                text-shadow: 1px 1px 4px $hero-text-shadow-light;

                @media (max-width: $breakpoint-tablet) {
                    font-size: 20px;
                }

                @media (max-width: $breakpoint-mobile) {
                    font-size: 18px;
                    margin-bottom: 6px;
                }

                @media (max-width: $breakpoint-small-mobile) {
                    font-size: 16px;
                }
            }

            .hero-description {
                font-size: 20px;
                font-weight: 400;
                color: $hero-text-color;
                margin: 0;
                line-height: 1.4;
                text-shadow: 1px 1px 4px $hero-text-shadow-light;

                p {
                    margin: 0;
                }

                @media (max-width: $breakpoint-tablet) {
                    font-size: 18px;
                }

                @media (max-width: $breakpoint-mobile) {
                    font-size: 16px;
                }

            }
        }
    }

    // Scroll Indicator
    .hero-scroll-indicator {
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
        color: $hero-text-color;
        animation: bounce 2s infinite;
        cursor: pointer;

        svg {
            filter: drop-shadow(1px 1px 2px $hero-text-shadow-light);
        }

        @media (max-width: $breakpoint-small-mobile) {
            bottom: 20px;
        }
    }

    // Text Positioning
    &[data-text-position="left"] {
        .hero-content {
            text-align: left;
        }

        .hero-text {
            max-width: 600px;
            margin-right: auto;
        }
    }

    &[data-text-position="center"] {
        .hero-content {
            text-align: center;
        }

        .hero-text {
            max-width: 800px;
            margin: 0 auto;
        }
    }

    &[data-text-position="right"] {
        .hero-content {
            text-align: right;
        }

        .hero-text {
            max-width: 600px;
            margin-left: auto;
        }
    }

    // Custom video controls
    &.has-custom-controls {
        .hero-video {
            pointer-events: none;
        }
    }

    // Responsive Design - Tablet
    @media (max-width: $breakpoint-tablet) {


        .hero-content {
            padding: 0 30px;
        }

        &[data-text-position="left"],
        &[data-text-position="right"] {
            .hero-text {
                max-width: 500px;
            }
        }
    }

    // Responsive Design - Mobile
    @media (max-width: $breakpoint-mobile) {
        align-items: normal;
        height: 620px;
        min-height: 400px;

        .hero-content {
            padding: 0 20px;
            margin-top: 120px;
        }

        &[data-text-position="left"],
        &[data-text-position="center"],
        &[data-text-position="right"] {
            .hero-text {
                max-width: 100%;
            }
        }
    }

    // Responsive Design - Small Mobile
    @media (max-width: $breakpoint-small-mobile) {}
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

// Global fallback for standalone hero backgrounds
.hero-background {
    .hero-mp4-video {
        width: 100%;
        object-position: center;
    }

    .hero-vimeo-video {
        width: 100% !important;
    }

    .hero-youtube-video {
        width: 100% !important;
    }
}