/* ============================================= */
/* CALL – CARD STYLES (горизонтальная лента)     */
/* ============================================= */

.user-cards-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 12px 20px;
    height: 160px;
    flex-shrink: 0;
    background: #1e1e2f;
    backdrop-filter: none;
    align-items: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 100;
    position: relative;
    cursor: grab;
    user-select: none;
    scroll-behavior: smooth;     /* <-- плавный скролл */
    will-change: scroll-position; /* <-- оптимизация */
}
.user-cards-container:active {
    cursor: grabbing;
}
.user-cards-container::-webkit-scrollbar {
    display: none;
}

/* Карточка – прямоугольная, с видео */
.user-card {
    flex: 0 0 auto;
    width: 260px;
    height: 160px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 6px 8px;
    text-align: center;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.user-card:hover {
    border-color: rgba(255,255,255,0.3);
}

.user-card-current {
    border-color: rgba(76, 175, 80, 0.6);
}

.user-card-speaking {
    border-color: #4caf50;
    box-shadow: 0 0 16px rgba(76, 175, 80, 0.4);
}

.user-card-pinned {
    border-color: #ff9800;
    box-shadow: 0 0 16px rgba(255, 152, 0, 0.4);
}

/* Видео внутри карточки */
.user-card-video {
    width: 100%;
    height: 80%;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
    flex-shrink: 0;
}

/* Аватарка */
.user-card-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.user-card-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.user-card-name {
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    margin: 2px 0 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    padding: 2px 4px;
    border-radius: 0 0 8px 8px;
}

.user-card-role {
    display: none;
}

/* Индикатор говорящего (зелёная точка) */
.user-card-speaking-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Индикатор закрепления (булавка) */
.user-card-pinned-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    color: #ff9800;
    font-size: 14px;
    text-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}

/* Адаптация */
@media (max-width: 768px) {
    .user-cards-container {
        height: 130px;
        gap: 8px;
        padding: 8px 12px;
    }
    .user-card {
        width: 120px;
        height: 100px;
    }
    .user-card-avatar,
    .user-card-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .user-card-name {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .user-cards-container {
        height: 110px;
        gap: 6px;
        padding: 6px 8px;
    }
    .user-card {
        width: 90px;
        height: 80px;
        border-radius: 8px;
    }
    .user-card-avatar,
    .user-card-avatar-placeholder {
        width: 32px;
        height: 32px;
        font-size: 18px;
        border-width: 1px;
    }
    .user-card-name {
        font-size: 8px;
    }
}

/* Светлая тема */
body.light-theme .user-cards-container {
    background: #f0f2f5;
}
body.light-theme .user-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-theme .user-card-name {
    color: #1e2a3a;
    background: rgba(255,255,255,0.8);
}
body.light-theme .user-card-current {
    border-color: var(--primary);
}
body.light-theme .user-card-speaking {
    border-color: #4caf50;
}
body.light-theme .user-card-pinned {
    border-color: #ff9800;
}