/* Balloon Animation Styles - Properly Scoped */
.balloon-animation-wrapper {
    width: 100%;
    background-color: var(--color-bg-gray);
    padding: 100px 0 0;
    margin-top: -25px;

    .balloon-animation-container {
        max-width: 1300px;
        margin: 0 auto;
        padding: 0 20px;
    }

    .balloon-animation-content {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 40px;
    }

    /* Left Column - Balloon Animation */
    .balloon-animation-left {
        flex: 1;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        min-height: 600px; /* Ensure sufficient height for animation */
    }

    .balloon-girl-image {
        position: relative;
        z-index: 2;
        margin: 0;
        max-width: 500px;
    }

    .balloon-animation {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
        pointer-events: none;
    }

    /* Balloon styling - for direct image elements */
    .balloon {
        position: absolute;
        width: 475px;
        max-width: 475px;
        height: auto;
        max-height: 1200px;
        pointer-events: none;
        z-index: 1;
        object-fit: contain;
        transform-origin: center bottom; /* Ensure animation pivots from bottom */
        transition: opacity 0.3s ease; /* Smooth opacity transitions */
        image-rendering: -webkit-optimize-contrast; /* Improve image quality */
        image-rendering: crisp-edges;
        -webkit-backface-visibility: hidden; /* Reduce flickering */
        backface-visibility: hidden;
        will-change: transform, opacity; /* Optimize for animation */
    }

    #blue-balloon {
        top: -50px;
        left: 55px;
    }

    #red-balloon {
        top: -40px;
        left: 55px;
    }

    #yellow-balloon {
        top: -40px;
        left: 55px;
    }

    /* Balloon dots styling - for separate elements */
    .dot {
        position: absolute;
        width: 65px;
        height: 65px;
        cursor: pointer;
        z-index: 20;
        transition: transform 0.3s ease, opacity 0.3s ease;
        pointer-events: auto;
        will-change: transform, opacity; /* Optimize for animation */
    }

    .dot img {
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

    .dot:hover {
        transform: scale(1.1);
    }

    #blue-dot {
        top: 145px;
        left: 265px;
    }

    #red-dot {
        top: 25px;
        left: 150px;
    }

    #yellow-dot {
        top: 25px;
        left: 370px;
    }

    /* Right Column - Content */
    .balloon-animation-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-bottom: 60px;
    }

    /* Title styling */
    .balloon-title-container {
        text-align: center;
        margin-bottom: 20px;
    }

    .balloon-title {
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-weight: 600;
    }

    .balloon-title .small {
        display: block;
        font-size: var(--font-size-balloon-title-small);
        line-height: var(--font-lh-balloon-title-small);
        margin: 0;
    }

    .balloon-title .big {
        font-size: var(--font-size-balloon-title-big);
        line-height: var(--font-lh-balloon-title-big);
        font-weight: 700;
        position: relative;
        margin: 0;
        padding: 0 15px;
        color: var(--color-red);
        text-transform: uppercase;
    }

    .balloon-title .big .balloon-border-top,
    .balloon-title .big .balloon-border-bottom{
        max-width: 600px;
        width: 100%;
        margin-bottom: 10px;
        color: var(--color-blue);
    }

    .balloon-title .big::before,
    .balloon-title .big::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: 8px;
        color: var(--color-blue);
    }

    .balloon-title .big::before {
        top: -15px;
    }

    .balloon-title .big::after {
        bottom: -15px;
    }

    .balloon-subtitle {
        font-size: var(--font-size-body);
        line-height: var(--font-lh-body);
        margin: 30px 0 0;
        font-style: italic;
        font-weight: 600;
    }

    .disclaimer-text {
        display: none;
    }

    /* Buttons styling */
    .balloon-buttons {
        display: flex;
        justify-content: center;
        margin: 40px 0;
    }

    .wp-block-buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
    }

    .balloon-button {
        margin: 0 10px;
    }

    .balloon-button a.wp-block-button__link {
        padding: 12px 25px;
        border-radius: 25px;
        font-weight: 600;
        font-size: var(--font-size-button-small);
        line-height: var(--font-lh-button-small);
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        color: white;
        background-color: var(--color-red);
        border: 2px solid var(--color-red);
    }

    .balloon-button a.wp-block-button__link:hover,
    .balloon-button a.wp-block-button__link.active {
        background-color: var(--color-white);
        color: var(--color-red);
    }

    /* Text block styling */
    .balloon-text-block {
        position: relative;
        margin: 0 0 30px;
        height: 200px;
        width: 625px;
        z-index: 2;
    }

    .balloon-text-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        margin: 0;
    }

    .balloon-text-background img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .balloon-text-content {
        position: relative;
        z-index: 2;
        padding: 30px 25px;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        min-height: 120px;
    }

    .balloon-text {
        font-size: var(--font-size-balloon-redbox-text);
        line-height: var(--font-lh-balloon-redbox-text);
        color: var(--color-white);
        text-align: center;
        font-weight: 600;
        margin: 0;
        padding: 0 10px;
        display: none;
        transition: opacity 0.3s ease;
    }

    .balloon-text.active {
        display: block;
        animation: balloonFadeIn 0.3s ease;
    }

    @keyframes balloonFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Component-specific text classes - properly prefixed */
    .balloon-text-default,
    .balloon-text-blue,
    .balloon-text-red,
    .balloon-text-yellow,
    .balloon-button-left-text,
    .balloon-button-middle-text,
    .balloon-button-right-text {
        max-width: 800px;
        margin: 0 auto;
    }

    .balloon-text-yellow{
        padding: 0 30px;
    }
    .balloon-text-blue{
        padding: 0 30px;
    }
    .balloon-text-red{
        padding: 0 40px;
    }
    .balloon-button-left-text{
        padding: 0 40px;
    }
    .balloon-button-middle-text{
        padding: 0 110px;
    }
    .balloon-button-right-text{
        padding: 0 60px
    }

    /* Footer text styling */
    .balloon-footer-text {
        position: relative;
        margin: -40px auto 0;
        width: 525px;
        height: 170px;
        font-size: var(--font-size-balloon-yellowbox-text);
        line-height: var(--font-lh-balloon-yellowbox-text);
    }

    .balloon-footer-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        margin: 0;
    }

    .balloon-footer-background img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .balloon-footer-content {
        position: relative;
        z-index: 2;
        padding: 20px 50px;
        text-align: center;
        font-size: var(--font-size-interactive-body);
        line-height: var(--font-lh-interactive-body);
        font-weight: 600;
        color: var(--color-nav-gray);
        margin-top: 20px;
    }

    @media (max-width: 1599px) {

        .balloon-title .small {
            font-size: 2.2rem;
            line-height: 3.2rem;
        }
    
        .balloon-title .big {
            font-size: 3.4rem;
            line-height: 4.2rem;
        }

        .balloon-animation-left {
            min-height: unset;
        }

        .balloon-animation-container{
            max-width: 1100px;
        }

        .balloon-girl-image{
            min-width: 490px;
        }

        #blue-balloon {
            top: -110px;
            left: 5px;
        }
    
        #red-balloon {
            top: -100px;
            left: 5px;
        }
    
        #yellow-balloon {
            top: -100px;
            left: 5px;
        }

        .dot {
            width: 55px;
            height: 55px;
        }
    
        #blue-dot {
            top: 95px;
            left: 220px;
        }
    
        #red-dot {
            top: -25px;
            left: 110px;
        }
    
        #yellow-dot {
            top: -25px;
            left: 330px;
        }

        /* Add responsive widths for text blocks while maintaining aspect ratio */
        .balloon-text-block {
            width: 525px;
            /* Remove fixed height to maintain aspect ratio */
            height: auto;
            aspect-ratio: 625/200;
        }

        .balloon-footer-text {
            width: 450px;
            /* Remove fixed height to maintain aspect ratio */
            height: auto;
            aspect-ratio: 525/170;
        }

        .balloon-footer-content{
            margin-top: 10px;
        }

        .balloon-buttons{
            margin: 20px 0;
        }

        .balloon-text {
            font-size: 1.8rem;
            line-height: 2.6rem;
        }
        .balloon-footer-content{
            font-size: 1.6rem;
            line-height: 2.4rem;
        }
    }

    @media (max-width: 1366px) {

        .balloon-title .small {
            font-size: 2.0rem;
            line-height: 2.0rem;
        }
    
        .balloon-title .big {
            font-size: 3.0rem;
            line-height: 3.5rem;
        }

        .balloon-subtitle{
            font-size: 1.6rem;
        }

        .balloon-animation-container{
            max-width: 1000px;
        }

        .balloon-girl-image{
            max-width: 390px;
            min-width: 390px;
        }

        /* Scale down balloons proportionally */
        .balloon {
            width: 350px;
            max-width: 350px;
        }

        #blue-balloon {
            top: -45px;
            left: 55px;
        }
    
        #red-balloon {
            top: -35px;
            left: 55px;
        }
    
        #yellow-balloon {
            top: -35px;
            left: 55px;
        }

        /* Scale down dots and adjust positions */
        .dot {
            width: 40px;
            height: 40px;
        }
    
        #blue-dot {
            top: 105px;
            left: 210px;
        }
    
        #red-dot {
            top: 10px;
            left: 130px;
        }
    
        #yellow-dot {
            top: 10px;
            left: 300px;
        }

        /* Scale down text blocks proportionally */
        .balloon-title .big{
            margin: 0;
        }

        .balloon-text-block {
            width: 400px;
            margin: 0 auto;
        }

        .balloon-text{
            font-size: 1.4rem;
            line-height: 2.2rem;
        }

        .balloon-footer-text {
            width: 350px;
        }

        .wp-block-buttons {
            gap: 0;
        }

        .balloon-button a.wp-block-button__link{
            padding: 8px 20px;
        }

        .balloon-footer-content {
            padding: 45px 40px;
            font-size: 1.2rem;
            line-height: 2.0rem;
        }

        /* Adjust gap between columns */
        .balloon-animation-content {
            gap: 30px;
        }
    }

    @media (max-width: 1023px) {

        .balloon-title .small {
            font-size: 1.8rem;
            line-height: 1.8rem;
        }
    
        .balloon-title .big {
            font-size: 2.4rem;
            line-height: 2.4rem;
            margin: 10px 0 0;
        }

        .balloon-title .big .balloon-border-bottom{
            margin-top: 20px;
        }

        .balloon-subtitle{
            font-size: 1.2rem;
            margin-top: 15px;
        }

        .balloon-animation-container{
            max-width: 700px;
        }

        .balloon-animation-right{
            padding-bottom: 0;
        }

        .balloon-girl-image{
            max-width: 300px;
            min-width: 300px;
        }

        /* Scale down balloons proportionally */
        .balloon {
            width: 300px;
            max-width: 300px;
        }

        #blue-balloon {
            top: -45px;
            left: 0px;
        }
    
        #red-balloon {
            top: -35px;
            left: 0px;
        }
    
        #yellow-balloon {
            top: -35px;
            left: 0px;
        }

        /* Scale down dots and adjust positions */
        .dot {
            width: 35px;
            height: 35px;
        }
    
        #blue-dot {
            top: 85px;
            left: 135px;
        }
    
        #red-dot {
            top: 10px;
            left: 65px;
        }
    
        #yellow-dot {
            top: 10px;
            left: 205px;
        }

        /* Scale down text blocks proportionally */

        .balloon-text-block {
            width: 350px;
            margin: 0 auto;
        }

        .balloon-text{
            font-size: 1.1rem;
            line-height: 1.8rem;
        }

        .balloon-footer-text {
            width: 300px;
            margin-top: -45px;
        }

        .balloon-button a.wp-block-button__link{
            padding: 8px 16px;
        }

        .balloon-footer-content {
            padding: 45px 40px;
            font-size: 1.0rem;
            line-height: 1.7rem;
        }

        /* Adjust gap between columns */
        .balloon-animation-content {
            gap: 30px;
        }
    }

    /* Hide mobile elements above 767px */
    .balloon-mobile-image,
    .balloon-mobile-nav-container {
        display: none;
    }

    @media (max-width: 767px) {
        .balloon-animation-wrapper {
            padding: 50px 0 0;
        }

        .balloon-animation-container {
            max-width: 100%;
            padding: 0;
        }

        .balloon-animation-content {
            flex-direction: column;
            gap: 20px;
        }

        .balloon-animation-left {
            display: none;
        }

        .balloon-animation-right {
            width: 100%;
            padding-bottom: 30px;
            position: relative;
        }

        .balloon-title-container {
            position: relative;
        }

        .balloon-title .small.mobile-short{
            padding: 0 100px;
        }

        .balloon-title .small {
            font-size: 1.8rem;
            line-height: 2.4rem;
        }

        .balloon-title .big {
            font-size: 2.6rem;
            line-height: 3.2rem;
            margin: 5px 0;
        }

        .balloon-subtitle {
            display: none;
        }

        .disclaimer-text {
            display: block;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            bottom: -30px;
            font-size: 1.0rem;
            line-height: 1.4rem;
        }

        .balloon-buttons {
            display: none;
        }

        /* Mobile-only elements */
        .balloon-mobile-image {
            position: relative;
            width: 100%;
            max-width: 250px;
            margin: 0 auto;
            display: block;
        }

        .balloon-mobile-image img {
            width: 100%;
            height: auto;
            opacity: 0;
            position: relative;
            top: 0;
            left: 0;
            transition: opacity 0.3s ease;
        }

        .balloon-mobile-image img.active {
            opacity: 1;
        }

        .balloon-mobile-image img.default {
            position: relative;
            opacity: 1;
        }

        /* Mobile navigation container - two dropdowns side by side */
        .balloon-mobile-nav-container {
            display: flex;
            position: relative;
            width: 95%;
            max-width: 500px;
            left: 50%;
            transform: translateX(-50%);
            bottom: 30px;
            z-index: 10;
            gap: 8px;
        }

        /* Responsive adjustments for smaller mobile screens */
        @media (max-width: 480px) {
            .balloon-mobile-nav-container {
                width: 100%;
                gap: 5px;
            }
            
            .balloon-mobile-nav-btn {
                font-size: 1.2rem;
                padding: 10px 12px;
            }
            
            .balloon-mobile-nav-option {
                font-size: 1.2rem;
                padding: 10px 12px;
            }
        }

        /* Individual dropdown styling */
        .balloon-mobile-nav {
            flex: 1;
            position: relative;
            background-color: var(--color-yellow);
            display: flex;
        }

        .balloon-mobile-nav-btn {
            display: none;
            width: 100%;
            padding: 5px 10px;
            min-height: 44px;
            background: none;
            border: none;
            color: var(--color-white);
            font-size: 1.4rem;
            line-height: 1.6rem;
            text-align: center;
            cursor: pointer;
        }

        .balloon-mobile-nav-btn.active {
            display: block;
            background: none;
            border: none;
            box-shadow: none;
            color: var(--color-red);
            position: relative;
            padding-right: 30px;
        }

        /* Dropdown arrow */
        .balloon-mobile-nav-btn.active::after {
            content: '';
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 5px solid var(--color-red);
        }

        /* Open dropdown state */
        .balloon-mobile-nav.open {
            height: 44px;
        }

        /* Dropdown options container */
        .balloon-mobile-nav-options {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background-color: var(--color-red);
            border-radius: 4px;
            margin-top: 1px;
            flex-direction: column;
            z-index: 15;
        }

        .balloon-mobile-nav.open .balloon-mobile-nav-options {
            display: flex;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
        }

        .balloon-mobile-nav-option {
            display: block;
            position: relative;
            text-align: center;
            padding: 12px 15px;
            color: var(--color-white);
            font-size: 1.4rem;
            line-height: 1.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .balloon-mobile-nav-option:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .balloon-mobile-nav-option.active {
            display: none;
        }

        .balloon-text-block {
            width: 100%;
            margin-top: -50px;
            background-color: var(--color-red);
        }

        .balloon-text-background{
            display: none;
        }

        .balloon-text-content{
            max-width: 350px;
            min-height: 156px;
            margin: 0 auto;
            padding: 30px 0;
        }

        .balloon-text {
            font-size: 1.6rem;
            line-height: 2.4rem;
            padding: 0 15px;
        }

        .balloon-footer-text {
            width: 80%;
            margin: -30px auto 0;
            background-color: var(--color-yellow);
            clip-path: var(--clip-path-mobile-headline);
        }

        .balloon-footer-background{
            display: none;
        }

        .balloon-footer-content {
            padding: 50px 20px 20px;
            font-size: 1.4rem;
            line-height: 2.0rem;
        }
    }
}
