/* ============ СТИЛИ ДЛЯ ТОП КОМПАНИЙ ============ */

/* Контейнер горизонтальной прокрутки */
.top-companies-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

/* Контейнер карточек с горизонтальным скроллом */
.top-companies-cards {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    
    /* 🔥 ДОБАВЛЕНО: Привязка к границам карточек */
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
}

.top-companies-cards::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Карточки ТОП компаний */
.top-company-card {
    flex: 0 0 330px;
    position: relative;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(13,26,41,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    
    /* 🔥 ДОБАВЛЕНО: Привязка к началу карточки */
    scroll-snap-align: start;
}

.top-company-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(13,26,41,0.1);
}

/* Корона для ТОП из ТОПов */
.crown {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 1.5rem;
    transform: rotate(-45deg);
    animation: crown-glow 2s ease-in-out infinite;
    z-index: 20;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

@keyframes crown-glow {
    0%, 100% { transform: rotate(-45deg) scale(1); }
    50% { transform: rotate(-45deg) scale(1.1); }
}

/* Стрелки прокрутки */
.scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--sea-turquoise);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--sea-turquoise);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: var(--sea-turquoise);
    color: var(--card-bg);
    transform: scale(1.1);
}

.scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.scroll-btn:disabled:hover {
    background: var(--card-bg);
    color: var(--sea-turquoise);
}

/* Индикатор прокрутки */
.scroll-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(95, 170, 184, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: var(--sea-turquoise);
    transform: scale(1.2);
}

.indicator-dot:hover {
    background: var(--sea-turquoise);
    transform: scale(1.1);
}

/* Сообщение об отсутствии ТОП компаний */
.no-top-companies {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-style: italic;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .scroll-btn {
        display: none; /* Скрываем стрелки на мобильных */
    }
    
    .top-companies-cards {
        padding: 10px 5px;
        /* 🔥 ДОБАВЛЕНО: На мобильных привязка с отступами */
        scroll-padding: 0 10px;
    }
    
    .top-company-card {
        flex: 0 0 260px;
    }
    
    .crown {
        top: -8px;
        left: -8px;
        font-size: 1.3rem;
    }
}

/* 🔥 ИСПРАВЛЕНИЕ: Фиксированная высота для всех метрик в ТОП карточках */
.top-company-card .metrics {
    height: 80px;
    display: flex;
    align-items: stretch;
    justify-content: space-between; /* Равномерное распределение */
}