/* Основные стили */
body {
    background-color: #1a1a1a;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
}

.stats-container {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Заголовок и общая сумма */
.main-title {
    text-align: center;
    font-size: 28px;
    color: white;
    margin: 0 0 20px 0;
}

.total-logo {
    position: absolute;
    top: 20px;
    left: 20px;
}

.total-logo img {
    width: 150px;
}

.total-summary {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 18px;
    color: white;
}
.total-summary span {
    font-size: 26px;
    font-weight: bold;
    color: #ff7c00;
}

/* Основной контент */
.stats-content {
    display: flex;
}

/* Левая колонка: Менеджеры */
.managers-column {
    flex: 2;
    padding-right: 20px;
}

.section-title {
    text-align: center;
    color: #ff7c00;
    font-size: 20px;
    margin: 0 0 20px 0;
}

/* Топ-3 менеджеров */
.top3-list {
    width: 60%;
    margin: 60px auto 70px auto;
}

.top3-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 25px; /* Увеличенный шрифт */
}

.medal {
    font-size: 24px;
    margin-right: 10px;
    width: 30px;
    text-align: center;
}

.medal-1 { color: #ffd700; } /* ★ */
.medal-2 { color: #c0c0c0; } /* ✪ */
.medal-3 { color: #cd7f32; } /* ● */

.employee-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    visibility: hidden; /* Скрываем фото, но сохраняем место */
}

.employee-photo.has-photo {
    visibility: visible; /* Показываем фото если оно есть */
}

.top3-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
}

.top3-name {
    color: white;
}

.top3-value {
    color: #ff7c00;
    font-weight: bold;
}

/* Остальные менеджеры */
.other-managers {
    display: flex;
}

.manager-column {
    flex: 1;
}

.manager-column:first-child {
    padding-right: 20px;
    border-right: 1px solid #ff7c00;
}

.manager-column.manager-space {
    padding-left: 15px;
}

.manager-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.manager-position {
    /*color: #ff7c00;*/
    color: #fff;
    width: 25px;
    text-align: right;
    margin-right: 10px;
}

.manager-name {
    color: white;
    flex-grow: 1;
}

.manager-value {
    color: #ff7c00;
    font-weight: bold;
}

/* Правая колонка: Команды */
.groups-column {
    flex: 1;
    padding-left: 20px;
    border-left: 3px solid #ff7c00;
    display: flex;
    flex-direction: column;
}

.groups-list {
    /*margin-top: 40px;*/
    width: 65%;
    margin: 40px auto 0;
}

.group-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.group-name {
    color: white;
    font-weight: bold;
    min-width: 100px;
    margin-left: 10px; /* Смещение первого group-name влево */
}
.group-row:first-child .group-name {
    margin-left: -15px;
}

.progress-container {
    flex-grow: 1;
    margin: 0 15px;
}

.progress-bar {
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background-color: #ff7c00;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5px;
    font-size: 12px;
    color: white;
}

.group-value {
    color: #ff7c00;
    font-weight: bold;
    width: 30px;
    text-align: right;
}

/* Блок с месяцем */
.month-info {
    margin-top: auto;
    text-align: center;
    padding-top: 20px;
}

.month-name {
    color: #ff7c00;
    font-size: 24px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.days-left {
    color: white;
    font-size: 18px;
}

/* Базовые стили */
.month-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.hours-block {
    margin-top: -10px;
}

.days-block, .hours-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hours-block.last-day .flip-card {
    /*background: #ff4444;*/
    color: white;
}

.hours-block.last-day .flip-separator {
    color: #ff4444;
}

.countdown-label {
    color: white;
    font-size: 18px;
    margin-bottom: 10px;
}

@font-face {
    font-family: 'Digital-7';
    src: url('/fonts/Digital-7/digital_7.ttf') format('truetype'); /* Укажите правильный путь */
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Digital Numbers';
    src: url('/fonts/DigitalNumbers-Regular.ttf') format('truetype'); /* Укажите правильный путь */
    font-weight: normal;
    font-style: normal;
}
.flip-clock {
    perspective: 400px;
    margin: 10px 0;
}

.flip-card {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 120px;
}

.flip-current, .flip-next {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Digital Numbers', monospace;
    font-size: 34px;
    /*font-weight: bold;*/
    /*color: white;*/
    background: #333;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.last-day .flip-current,
.last-day .flip-next {
    color: #ff3333;
    box-shadow: 0 2px 10px rgba(255, 50, 50, 0.7);
}

.flip-next {
    background: #444;
    transform: rotateX(180deg);
    backface-visibility: hidden;
}

/* Анимация переворота */
.flip-animate .flip-current {
    animation: flipDown 0.6s ease-in forwards;
}

.flip-animate .flip-next {
    animation: flipUp 0.6s ease-out 0.3s forwards;
}

@keyframes flipDown {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(-180deg); }
}

@keyframes flipUp {
    0% { transform: rotateX(180deg); }
    100% { transform: rotateX(0deg); }
}

/* Дополнительные стили */
.flip-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #222;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.flip-current {
    border-bottom: 1px solid #222;
}

.flip-next {
    border-top: 1px solid #555;
}

/* Общие стили flip-часов */
.flip-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 400px;
}

.flip-card {
    position: relative;
    width: 60px;
    height: 90px;
    margin: 0 5px;
}

.flip-separator {
    font-size: 48px;
    color: white;
    margin: 0 5px;
    align-self: flex-end;
    padding-bottom: 15px;
}

/* Анимация изменённых значений */
/* */ @keyframes highlightChange {
    0% { background-color: rgba(255, 124, 0, 0.3); }
    100% { background-color: transparent; }
}

.changed-value {
    animation: highlightChange 2s ease;
}

/* Основные анимации */
.manager-item {
    transition:
            transform 1.2s ease-in-out,
            opacity 1s ease-in-out,
            background-color 0.5s ease;
    will-change: transform, opacity;
}

/* Анимация появления */
.manager-enter {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
}

.manager-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
            transform 1.5s cubic-bezier(0.2, 0.9, 0.3, 1.1),
            opacity 1.2s ease-out;
}

/* Анимация исчезновения */
.manager-exit {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.manager-exit-active {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
    transition:
            transform 1.2s ease-in,
            opacity 1s ease-in;
}

/* Стили для списков */
.managers-list-container {
    position: relative;
    min-height: 120px;
    overflow: hidden;
}

.top3-list, .other-managers {
    position: relative;
}


/* Телевизионная адаптация */
/* Для очень больших TV (4K) */
@media screen and (min-width: 3840px) {
    body {
        font-size: 32px;
    }
    /* ... */
}
@media screen and (min-width: 1025px) {
    body {
        padding: 7px;
    }
    .top3-item {
        font-size: 34px;
        margin-bottom: 15px;
    }
    .manager-row {
        margin-bottom: 12px;
        font-size: 26px;
    }
    .manager-position {
        width: 30px;
    }
    .group-name {
        min-width: 127px;
        margin-left: 27px;
        font-size: 20px;
    }
    .group-row:first-child .group-name {
        width: 160px;
        margin-left: -5px;
    }
}
@media screen and (min-width: 1920px) {
    body {
        font-size: 24px; /* Слегка уменьшил для компактности */
        padding: 10px; /* Уменьшил отступы */
    }

    .stats-container {
        padding: 30px;
        max-width: 95vw; /* Занимает почти всю ширину */
        height: 95vh; /* Занимает почти всю высоту */
        box-sizing: border-box;
        overflow: hidden; /* Убираем скролл */
    }

    .total-logo img {
        width: 250px;
    }

    .main-title {
        font-size: 42px;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 32px;
        margin-bottom: 45px;
        margin-top: 60px;
    }

    /* Компактный топ-3 */
    .top3-list {
        width: 60%;
        margin: 0 auto 60px;
        padding: 0;
    }

    .top3-item {
        font-size: 40px;
        margin-bottom: 15px;
    }

    .medal {
        font-size: 32px;
        margin-right: 20px;
    }

    .employee-photo {
        width: 60px;
        height: 60px;
        margin-right: 20px;
    }

    /* Более компактные ряды */
    .manager-row {
        margin-bottom: 12px;
        font-size: 36px;
    }
    .group-row {
        margin-bottom: 14px;
    }

    .group-name {
        min-width: 213px;
        margin-left: 39px;
        font-size: 28px;
    }
    .group-row:first-child .group-name {
        width: 257px;
        margin-left: -5px;
    }

    .group-value {
        width: 40px;
    }

    /* Оптимизация колонок */
    .other-managers {
        max-height: 40vh;
        display: flex;
        flex-wrap: wrap;
        margin: 80px auto 0;
    }

    .manager-column {
        flex: 1 0 45%;
        padding: 0 10px;
    }

    .manager-column:first-child {
        border-right: 1px solid #ff7c00;
    }

    .manager-position {
        width: 50px;
    }

    /* Команды */
    .groups-column {
        height: 85vh;
        position: relative;
    }
    .groups-list {
        /*margin-top: 0;*/
        /*margin-top: 45px;*/
        max-height: 30vh;
        overflow: hidden;
        width: 65%;
        margin: 0 auto;
    }

    .progress-bar {
        height: 25px;
    }

    /* Месяц внизу */
    .month-countdown {
        /*gap: 30px;*/
    }

    .hours-block {
        margin-top: -15px;
    }

    .month-info {
        position: absolute;
        /*bottom: 20px;*/
        bottom: 5px;
        left: 0;
        right: 0;
        padding-top: 10px;
    }

    .month-name {
        font-size: 28px;
    }

    .days-left {
        font-size: 24px;
    }
    .days-left div {
        font-size: 48px;
        margin: 20px 0;
    }

    .countdown-label {
        font-size: 28px;
    }

    .flip-card {
        width: 120px;
        height: 180px;
    }


    .hours-block.last-day .flip-current,
    .hours-block.last-day .flip-next {
        color: #ff3333;
        box-shadow: 0 2px 10px rgba(255, 50, 50, 0.7);
    }

    .flip-current, .flip-next {
        font-size: 56px;
        /*font-size: 90px;*/
    }

    .countdown-text {
        font-size: 28px;
    }

    .flip-card {
        width: 90px;
        height: 135px;
    }

    .flip-separator {
        font-size: 72px;
        padding-bottom: 25px;
    }
}