/* ─────────────────────────────────────────────────────────
   SWISSINJECTION — ANIMATIONEN V1
   Moderne, subtile Animationen für besseres UX
───────────────────────────────────────────────────────── */

/* ── Mobile Menu Scroll Fix ──────────────────────────── */
.si-mobile-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #111111 !important;
    z-index: 9998 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1) !important;
    padding-top: 80px !important;
    padding-bottom: env(safe-area-inset-bottom, 32px) !important;
    display: block !important;
    will-change: transform;
    touch-action: pan-y !important;
}

.si-mobile-menu.open {
    transform: translateX(0) !important;
}

.si-mobile-menu a,
.si-mobile-menu .si-mobile-menu__link {
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    touch-action: manipulation !important;
}

/* ── Scroll-triggered Fade-in ────────────────────────── */
.si-animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.si-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.si-animate--delay-1 { transition-delay: 0.1s; }
.si-animate--delay-2 { transition-delay: 0.2s; }
.si-animate--delay-3 { transition-delay: 0.3s; }
.si-animate--delay-4 { transition-delay: 0.4s; }
.si-animate--delay-5 { transition-delay: 0.5s; }

.si-animate--left {
    transform: translateX(-24px);
}
.si-animate--left.visible {
    transform: translateX(0);
}

.si-animate--scale {
    transform: scale(0.95);
}
.si-animate--scale.visible {
    transform: scale(1);
}

/* ── Card Hover ──────────────────────────────────────── */
.si-card {
    transition: transform 0.25s ease,
                box-shadow 0.25s ease,
                border-color 0.25s ease !important;
}

.si-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
}

.si-card--service:hover .si-card__icon {
    background: rgba(211,31,38,0.18) !important;
    transform: scale(1.05);
    transition: all 0.25s ease;
}

/* ── Buttons ─────────────────────────────────────────── */
.si-btn {
    transition: transform 0.2s ease,
                box-shadow 0.2s ease,
                background 0.2s ease,
                color 0.2s ease !important;
}

.si-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(211,31,38,0.3) !important;
}

.si-btn:active {
    transform: translateY(0) !important;
}

/* ── Hero Animationen ────────────────────────────────── */
.si-hero__badge {
    animation: fadeInDown 0.6s ease both;
    animation-delay: 0.1s;
}

.si-hero__title {
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.2s;
}

.si-hero__sub {
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.35s;
}

.si-hero__actions {
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.5s;
}

.si-hero__stats {
    animation: fadeInUp 0.7s ease both;
    animation-delay: 0.65s;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Pulsierender roter Punkt im Hero Badge ──────────── */
.si-hero__badge-dot {
    width: 8px;
    height: 8px;
    background: #D31F26;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(211,31,38,0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(211,31,38,0); }
    100% { box-shadow: 0 0 0 0 rgba(211,31,38,0); }
}

/* ── Counter Stats ───────────────────────────────────── */
.si-hero__stat-value {
    display: inline-block;
    transition: transform 0.3s ease;
}

.si-hero__stat:hover .si-hero__stat-value {
    transform: scale(1.1);
    color: #D31F26;
}

/* ── Navigation Link Underline ───────────────────────── */
.si-nav__link {
    position: relative;
}

.si-nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #D31F26;
    transition: width 0.25s ease;
}

.si-nav__link:hover::after,
.si-nav__link.active::after {
    width: 100%;
}

/* ── Logo Hover ──────────────────────────────────────── */
.si-header__logo img {
    transition: opacity 0.2s ease;
}

.si-header__logo:hover img {
    opacity: 0.85;
}

/* ── Input Focus ─────────────────────────────────────── */
.si-form__input,
.si-form__select,
.si-form__textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* ── V12 Featured gradient edge ─────────────────────── */
.si-card--featured {
    position: relative;
    isolation: isolate;
    background: #fff;
    color: #1A1A1A;
    border: none !important;
}

.si-card--featured .si-card__title,
.si-card--featured h2,
.si-card--featured h3 {
    color: #1A1A1A;
}

.si-card--featured .si-card__text,
.si-card--featured p {
    color: #595959;
}

.si-card--featured::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(45deg, #D31F26, #ff6b6b, #D31F26, #1A1A1A);
    background-size: 300% 300%;
    animation: gradientBorder 3s ease infinite;
    z-index: -1;
}

@keyframes gradientBorder {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── V12 Hero motion and typewriter ─────────────────── */
.si-hero {
    position: relative;
    overflow: hidden;
}

.si-hero__bg-pattern {
    animation: floatPattern 10s ease-in-out infinite;
}

@keyframes floatPattern {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50%      { transform: translate3d(0,-18px,0) scale(1.02); }
}

.si-hero__badge {
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    border-right: 2px solid #D31F26;
    white-space: nowrap;
    animation: typing 1.5s steps(40) 0.5s both, blink 0.8s step-end infinite;
}

@keyframes typing {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ── V12 Image reveal ───────────────────────────────── */
.si-img-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.8s cubic-bezier(0.77,0,0.175,1);
}

.si-img-reveal.visible {
    clip-path: inset(0 0 0 0);
}

/* ── V12 Stagger grids ──────────────────────────────── */
.si-stagger > * {
    opacity: 0;
    transform: translateY(20px);
}

.si-stagger.visible > *:nth-child(1) { animation: fadeUp 0.5s ease 0.0s both; }
.si-stagger.visible > *:nth-child(2) { animation: fadeUp 0.5s ease 0.1s both; }
.si-stagger.visible > *:nth-child(3) { animation: fadeUp 0.5s ease 0.2s both; }
.si-stagger.visible > *:nth-child(4) { animation: fadeUp 0.5s ease 0.3s both; }
.si-stagger.visible > *:nth-child(5) { animation: fadeUp 0.5s ease 0.4s both; }
.si-stagger.visible > *:nth-child(6) { animation: fadeUp 0.5s ease 0.5s both; }
.si-stagger.visible > *:nth-child(7) { animation: fadeUp 0.5s ease 0.6s both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.si-card:hover .si-card__icon img {
    animation: iconPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes iconPop {
    0%   { transform: scale(0.8); }
    100% { transform: scale(1); }
}

/* ── V12 CTA shimmer and page entrance ──────────────── */
.si-cta-banner {
    position: relative;
    overflow: hidden;
}

.si-cta-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 40px;
    height: 200%;
    background: rgba(255,255,255,0.06);
    transform: rotate(15deg);
    animation: shimmerBanner 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerBanner {
    0%   { left: -50%; }
    100% { left: 150%; }
}

.si-page-transition {
    animation: pageIn 0.4s ease both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.si-form__input:focus,
.si-form__select:focus,
.si-form__textarea:focus {
    border-color: #D31F26 !important;
    box-shadow: 0 0 0 3px rgba(211,31,38,0.12) !important;
    outline: none !important;
}

/* ── Blog Card Image Zoom ────────────────────────────── */
.si-blog-card {
    overflow: hidden;
}

.si-blog-card__img {
    overflow: hidden;
}

.si-blog-card__img img {
    transition: transform 0.4s ease !important;
}

.si-blog-card:hover .si-blog-card__img img {
    transform: scale(1.04) !important;
}

/* ── Filament Card Hover ─────────────────────────────── */
.si-fil-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.si-fil-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}

/* ── Staggered Grid Delays ───────────────────────────── */
.si-services .si-card:nth-child(1) { animation-delay: 0.0s; }
.si-services .si-card:nth-child(2) { animation-delay: 0.1s; }
.si-services .si-card:nth-child(3) { animation-delay: 0.2s; }
.si-services .si-card:nth-child(4) { animation-delay: 0.3s; }
.si-services .si-card:nth-child(5) { animation-delay: 0.4s; }
.si-services .si-card:nth-child(6) { animation-delay: 0.5s; }
.si-services .si-card:nth-child(7) { animation-delay: 0.6s; }

/* ── Scroll-to-Top Button ────────────────────────────── */
.si-scroll-top {
    position: fixed;
    bottom: 32px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #1A1A1A;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.si-scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.si-scroll-top:hover {
    background: #D31F26;
    transform: translateY(-2px);
}

/* ── Sticky CTA (mobile) ─────────────────────────────── */
@media (max-width: 767px) {
    .si-sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: rgba(26,26,26,0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 997;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .si-sticky-cta.visible {
        transform: translateY(0);
    }

    .si-sticky-cta .si-btn {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .si-sticky-cta {
        display: none;
    }
}

/* ── Cookie Banner ───────────────────────────────────── */
.si-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1A1A1A;
    color: #fff;
    padding: 16px 24px;
    z-index: 9999;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
    border-top: 2px solid #D31F26;
}

.si-cookie-banner__content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.si-cookie-banner__content p {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    flex: 1;
    min-width: 200px;
}

.si-cookie-banner__content a {
    color: #D31F26;
    text-decoration: underline;
}

/* ── Skeleton Loading ────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.si-skeleton {
    background: linear-gradient(90deg,
        #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ── Chat Online Indicator ───────────────────────────── */
.si-chat__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 0;
}

.si-chat__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.si-chat__status--online .si-chat__status-dot {
    background: #22c55e;
    animation: pulse-green 2s infinite;
}

.si-chat__status--offline .si-chat__status-dot {
    background: #8C8C8C;
}

@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Reduced Motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .si-animate {
        opacity: 1;
        transform: none;
    }
}
