/* Лента активности — слайдер: сдвиг влево, новый юзер заходит справа */

.activity-bar-outer {
    padding: 0 0 10px;
    position: relative;
    z-index: 2;
}

.activity-bar {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 1);
    -webkit-backdrop-filter: blur(5.5px) saturate(128%);
    backdrop-filter: blur(5.5px) saturate(128%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65) inset,
        0 6px 28px rgba(88, 70, 140, 0.09);
    -webkit-transition:
        opacity 0.35s ease,
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        -webkit-filter 0.35s ease;
    transition:
        opacity 0.35s ease,
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        filter 0.35s ease;
}

.activity-bar__live {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding-right: 14px;
    margin-right: 4px;
    border-right: 1px solid rgba(88, 70, 140, 0.12);
}

.activity-bar__live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    -webkit-animation: activity-bar-pulse 2s ease-in-out infinite;
    animation: activity-bar-pulse 2s ease-in-out infinite;
}

.activity-bar__live-text {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(88, 70, 140, 0.45);
}

.activity-bar__rail {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.activity-bar__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: -webkit-max-content;
    width: max-content;
    /* Было смещение через :first-child у айтема — при смене первого после слайда ломалась вёрстка */
    padding-left: 4px;
    -webkit-transition: -webkit-transform 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: transform 0.48s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.activity-bar__track.activity-bar__track--animating {
    will-change: transform;
}

.activity-bar__item {
    flex: 0 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    min-width: 0;
}

.activity-bar__item + .activity-bar__item {
    border-left: 1px solid rgba(88, 70, 140, 0.12);
}

/* Карточка посетителя после отправки формы (имя из first_name) */
.activity-bar__item--you {
    background: rgba(254, 249, 195, 0.92);
    border-radius: 10px;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.45);
}

.activity-bar__item-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    color: #3d2f66;
}

.activity-bar__item-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.activity-bar__item-icon--avatar {
    width: 28px;
    height: 28px;
}

.activity-bar__item-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.activity-bar__item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    line-height: 1.15;
}

.activity-bar__name {
    font-size: 14px;
    font-weight: 700;
    color: #2f2558;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.activity-bar__suffix {
    font-size: 11px;
    font-weight: 500;
    color: rgba(88, 70, 140, 0.48);
    white-space: nowrap;
}

.activity-bar.activity-bar--dim {
    opacity: 0.62;
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 4px 18px rgba(88, 70, 140, 0.05);
}

/* Доп. размытие всей ленты при скролле; при наведении убирается */
.activity-bar.activity-bar--scroll-blur:not(:hover) {
    -webkit-filter: blur(0.35px);
    filter: blur(0.35px);
}

.activity-bar:hover,
.activity-bar.activity-bar--dim:hover {
    opacity: 1;
    -webkit-filter: none;
    filter: none;
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 8px 32px rgba(88, 70, 140, 0.1);
}

@-webkit-keyframes activity-bar-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

@keyframes activity-bar-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

@media (prefers-reduced-motion: reduce) {
    .activity-bar__track {
        -webkit-transition: none;
        transition: none;
    }
}

@media (max-width: 991px) {
    .activity-bar {
        padding: 9px 12px;
        border-radius: 14px;
    }

    .activity-bar__live {
        padding-right: 10px;
    }

    .activity-bar__name {
        font-size: 13px;
        max-width: 120px;
    }

    .activity-bar__suffix {
        font-size: 10px;
    }

    .activity-bar__item {
        padding: 2px 8px;
        gap: 6px;
    }

    .activity-bar__item-icon {
        width: 26px;
        height: 34px;
    }

    .activity-bar__item-icon svg {
        width: 22px;
        height: 22px;
    }

    .activity-bar__item-icon--avatar,
    .activity-bar__item-icon-img {
        width: 26px;
        height: 26px;
    }
}

@media (max-width: 575px) {
    .activity-bar-outer {
        padding: 0 0 8px;
    }

    .activity-bar {
        padding: 8px 10px;
        border-radius: 12px;
    }

    .activity-bar__live-text {
        font-size: 11px;
    }

    .activity-bar__name {
        font-size: 12px;
        max-width: 100px;
    }

    .activity-bar__suffix {
        font-size: 10px;
    }

    .activity-bar__item-icon {
        width: 24px;
        height: 32px;
    }

    .activity-bar__item-icon svg {
        width: 22px;
        height: 22px;
    }

    .activity-bar__item-icon--avatar,
    .activity-bar__item-icon-img {
        width: 24px;
        height: 24px;
    }
}

/* Липкая шапка + лента (вместо fixed у .header в main.css) */
.header-activity-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 200;
    margin-bottom: -70px;
  
}

.header-activity-sticky .header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
}

/* Главная: липкий блок внутри .welcome — фон только у .welcome (main.css) */
main > section.welcome:has(> .header-activity-sticky) {
    padding-top: 0;
    overflow: visible;
}

@media (width <= 47.99875rem) {
    main > section.welcome:has(> .header-activity-sticky) {
        padding-top: 0;
    }
}
