/* =========================================
   DEMO RIBBON / MUSTERSEITE BADGE
   1:1 copy from the existing demo templates.
   ========================================= */
.template-demo-ribbon {
    position: fixed;
    top: 28px;
    right: -78px;
    z-index: 1200;
    width: 320px;
    min-height: 74px;
    transform: rotate(45deg);
    pointer-events: auto;
    isolation: isolate;
}

.template-demo-ribbon__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    width: 100%;
    min-height: 74px;
    padding: 0.78rem 2.7rem 0.72rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.96);
    text-align: center;
    background:
        linear-gradient(
            135deg,
            rgba(30, 19, 29, 0.86) 0%,
            rgba(72, 48, 68, 0.78) 36%,
            rgba(139, 92, 246, 0.54) 70%,
            rgba(30, 19, 29, 0.86) 100%
        );
    background-size: 220% 220%;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 14px 38px rgba(0, 0, 0, 0.28),
        0 0 34px rgba(139, 92, 246, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    transition:
        background-position 0.85s ease,
        box-shadow 0.45s ease,
        filter 0.45s ease,
        transform 0.45s ease;
    animation: demoRibbonBreath 7s ease-in-out infinite;
}

.template-demo-ribbon__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.08) 28%,
            rgba(255, 255, 255, 0.34) 48%,
            rgba(255, 255, 255, 0.08) 68%,
            transparent 100%
        );
    transform: translateX(-130%) skewX(-18deg);
    animation: demoRibbonShimmer 6.8s ease-in-out infinite;
}

.template-demo-ribbon__inner::after {
    content: '';
    position: absolute;
    inset: 7px 0;
    z-index: -2;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 22%,
            rgba(255, 255, 255, 0.18) 50%,
            rgba(255, 255, 255, 0.1) 78%,
            rgba(255, 255, 255, 0) 100%
        );
    opacity: 0.65;
}

.template-demo-ribbon__label {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.template-demo-ribbon__subtitle {
    display: block;
    font-size: 0.70rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.78);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.28);
}

.template-demo-ribbon:hover .template-demo-ribbon__inner {
    background-position: 100% 50%;
    filter: saturate(1.28) brightness(1.1);
    box-shadow:
        0 16px 44px rgba(0, 0, 0, 0.32),
        0 0 42px rgba(139, 92, 246, 0.28),
        0 0 34px rgba(236, 72, 153, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14);
    animation: demoRibbonChameleon 2.6s linear infinite;
}

.template-demo-ribbon:hover .template-demo-ribbon__inner::before {
    animation-duration: 2.2s;
}

@keyframes demoRibbonShimmer {
    0% {
        transform: translateX(-130%) skewX(-18deg);
        opacity: 0;
    }

    16% {
        opacity: 0.85;
    }

    34% {
        transform: translateX(130%) skewX(-18deg);
        opacity: 0;
    }

    100% {
        transform: translateX(130%) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes demoRibbonBreath {
    0%,
    100% {
        filter: saturate(1) brightness(1);
    }

    50% {
        filter: saturate(1.08) brightness(1.05);
    }
}

@keyframes demoRibbonChameleon {
    0% {
        background:
            linear-gradient(
                135deg,
                rgba(30, 19, 29, 0.88) 0%,
                rgba(139, 92, 246, 0.72) 34%,
                rgba(236, 72, 153, 0.62) 68%,
                rgba(30, 19, 29, 0.88) 100%
            );
    }

    25% {
        background:
            linear-gradient(
                135deg,
                rgba(30, 19, 29, 0.88) 0%,
                rgba(236, 72, 153, 0.68) 34%,
                rgba(245, 158, 11, 0.58) 68%,
                rgba(30, 19, 29, 0.88) 100%
            );
    }

    50% {
        background:
            linear-gradient(
                135deg,
                rgba(30, 19, 29, 0.88) 0%,
                rgba(245, 158, 11, 0.62) 34%,
                rgba(34, 197, 94, 0.54) 68%,
                rgba(30, 19, 29, 0.88) 100%
            );
    }

    75% {
        background:
            linear-gradient(
                135deg,
                rgba(30, 19, 29, 0.88) 0%,
                rgba(34, 197, 94, 0.58) 34%,
                rgba(14, 165, 233, 0.6) 68%,
                rgba(30, 19, 29, 0.88) 100%
            );
    }

    100% {
        background:
            linear-gradient(
                135deg,
                rgba(30, 19, 29, 0.88) 0%,
                rgba(139, 92, 246, 0.72) 34%,
                rgba(236, 72, 153, 0.62) 68%,
                rgba(30, 19, 29, 0.88) 100%
            );
    }
}

@media (max-width: 767.98px) {
    .template-demo-ribbon {
        top: 18px;
        right: -78px;
        width: 270px;
        min-height: 62px;
    }

    .template-demo-ribbon__inner {
        min-height: 62px;
        padding: 0.64rem 2.3rem 0.60rem;
    }

    .template-demo-ribbon__label {
        font-size: 0.76rem;
        letter-spacing: 0.11em;
    }

    .template-demo-ribbon__subtitle {
        font-size: 0.61rem;
        letter-spacing: 0.07em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .template-demo-ribbon__inner,
    .template-demo-ribbon__inner::before {
        animation: none !important;
    }

    .template-demo-ribbon:hover .template-demo-ribbon__inner {
        animation: none !important;
    }
}
