/* Styling for bølgeeffekten */

/* Container for bølgene */
.wave-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

body:has(.wave-background) .app-main {
    background: transparent;
    isolation: isolate;
    position: relative;
}

.wave-background ~ * {
    position: relative;
    z-index: 1;
}

/* Felles styling for bølgene */
.wave {
    width: 320vw; /* Keep the SVG edges far outside the viewport while the waves move */
    min-width: 1800px;
    max-width: none;
    height: 140%; /* Extend beyond the bottom edge while keeping the crest visible */
    position: absolute;
    bottom: -30%; /* Keep the flat SVG base outside the viewport without hiding the wave */
    left: -110vw;
    will-change: transform;
}

/* Første bølge */
.wave-1 {
    animation: waveMove1 15s ease-in-out infinite;
    fill-opacity: 0.5;
}

/* Andre bølge */
.wave-2 {
    animation: waveMove2 20s ease-in-out infinite;
    fill-opacity: 0.3;
    bottom: -24%;
}

/* Tredje bølge */
.wave-3 {
    animation: waveMove3 25s ease-in-out infinite;
    fill-opacity: 0.2;
    bottom: -18%;
}

@media (prefers-reduced-motion: reduce) {
    .wave-1,
    .wave-2,
    .wave-3 {
        animation: none;
    }

    .wave-2,
    .wave-3 {
        display: none;
    }

    .wave {
        bottom: -35%;
        height: 115%;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .wave {
        width: 340vw;
        min-width: 1400px;
        bottom: -24%;
        height: 130%;
        left: -120vw;
    }

    .wave-2 {
        bottom: -18%;
    }

    .wave-3 {
        bottom: -12%;
    }
}

/* Animasjoner for bølgene */
@keyframes waveMove1 {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0.5;
    }
    50% {
        transform: translate3d(-22%, 0, 0);
        opacity: 0.7;
    }
    100% {
        transform: translate3d(0, 0, 0); /* Går tilbake til startposisjon */
        opacity: 0.5;
    }
}

@keyframes waveMove2 {
    0% {
        transform: translate3d(-18%, 0, 0);
        opacity: 0.3;
    }
    50% {
        transform: translate3d(4%, 0, 0);
        opacity: 0.5;
    }
    100% {
        transform: translate3d(-18%, 0, 0); /* Går tilbake til startposisjon */
        opacity: 0.3;
    }
}

@keyframes waveMove3 {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0.2;
    }
    50% {
        transform: translate3d(-16%, 0, 0);
        opacity: 0.4;
    }
    100% {
        transform: translate3d(0, 0, 0); /* Går tilbake til startposisjon */
        opacity: 0.2;
    }
}
