/**
 * Стили для страницы Зал Славы (Hall of Fame)
 */

/* ===========================================
   Карточки топ-5 пилотов
   =========================================== */

.hof-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.hof-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Золото - 1 место */
.hof-card.hof-gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border-color: #ffc107;
}

.hof-card.hof-gold .hof-position {
    color: #b8860b;
    font-size: 2rem;
}

/* Серебро - 2 место */
.hof-card.hof-silver {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #adb5bd;
}

.hof-card.hof-silver .hof-position {
    color: #6c757d;
    font-size: 2rem;
}

/* Бронза - 3 место */
.hof-card.hof-bronze {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d4 100%);
    border-color: #cd7f32;
}

.hof-card.hof-bronze .hof-position {
    color: #cd7f32;
    font-size: 2rem;
}

/* Позиция в карточке */
.hof-position {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Время круга */
.hof-time {
    font-family: 'Roboto Mono', monospace;
    color: var(--bs-primary);
}

/* Сектора */
.hof-sectors {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
}

/* ===========================================
   Live Timing карта
   =========================================== */

.hof-map-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper имеет точный размер изображения для позиционирования точек */
.hof-map-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;  /* убирает gap под изображением */
}

.hof-map-image {
    display: block;
    max-width: 100%;
    max-height: 400px;
    height: auto;
    width: auto;
    vertical-align: top;  /* убирает baseline gap */
}

.hof-map-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.hof-map-status .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
}

/* Точки машин на карте (стиль ACSM) */
.hof-car-dot {
    position: absolute;
    z-index: 10;
    transition: 500ms linear;
    /* КРИТИЧНО: явные размеры для правильного центрирования */
    width: 12px;
    height: 16px;
    /* Центрирование точки на координатах */
    transform: translate(-50%, -50%);
}

/* Стрелка (треугольник) - основной визуальный элемент */
.hof-car-dot .dot-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 14px solid #ff0000;
    top: 0;
    left: 0;
    transform-origin: center center;
    transition: transform 100ms linear;
}

/* Имя водителя (инициалы) */
.hof-car-dot .hof-car-name {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
    white-space: nowrap;
    pointer-events: none;
}

/* ===========================================
   PRO badges
   =========================================== */

.badge[data-bs-toggle="tooltip"] {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.badge[data-bs-toggle="tooltip"]:hover {
    transform: scale(1.1);
}

/* ===========================================
   Таблица результатов
   =========================================== */

.table tbody tr.table-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.table tbody tr.table-secondary {
    background-color: rgba(108, 117, 125, 0.1) !important;
}

.table tbody tr.table-info {
    background-color: rgba(205, 127, 50, 0.1) !important;
}

/* Моноширинный шрифт для времени */
.table td:nth-child(4),
.table td:nth-child(5),
.table td:nth-child(6),
.table td:nth-child(7),
.table td:nth-child(8) {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.875rem;
}

/* ===========================================
   Hero секция
   =========================================== */

.card.bg-primary {
    background: linear-gradient(135deg, #696cff 0%, #5f61e6 100%) !important;
}

/* ===========================================
   Статистика трека
   =========================================== */

.col-md-4 .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.col-md-4 .card i.ti {
    opacity: 0.8;
}

/* ===========================================
   Адаптивность
   =========================================== */

@media (max-width: 768px) {
    .hof-map-container {
        height: 300px;
    }

    .hof-card .hof-position {
        font-size: 1.5rem;
    }

    .hof-time {
        font-size: 1.25rem !important;
    }

    .hof-sectors {
        font-size: 0.7rem;
    }

    /* Скрываем PRO badges на мобильных */
    .card-header .badge {
        display: none;
    }
}

@media (max-width: 576px) {
    .hof-map-container {
        height: 250px;
    }

    /* Статистика в одну колонку */
    .col-md-4 {
        margin-bottom: 0.5rem;
    }
}

/* ===========================================
   Dark mode поддержка
   =========================================== */

[data-bs-theme="dark"] .hof-card.hof-gold {
    background: linear-gradient(135deg, #3d3a00 0%, #2d2b00 100%);
    border-color: #ffc107;
}

[data-bs-theme="dark"] .hof-card.hof-silver {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-color: #6c757d;
}

[data-bs-theme="dark"] .hof-card.hof-bronze {
    background: linear-gradient(135deg, #3d2a00 0%, #2d1f00 100%);
    border-color: #cd7f32;
}

[data-bs-theme="dark"] .hof-map-container {
    background: #0d0d15;
}

/* ===========================================
   Анимации
   =========================================== */

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.ti-live-photo {
    animation: pulse 2s infinite;
}

/* ===========================================
   Пагинация
   =========================================== */

.pagination .page-link {
    border-radius: 4px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* ===========================================
   Сервер офлайн
   =========================================== */

.ti-server-off {
    animation: pulse 2s infinite;
}

/* Кнопки выбора других серверов */
.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(105, 108, 255, 0.3);
}

/* ===========================================
   Информация о трассе
   =========================================== */

.alert-light.border {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-bs-theme="dark"] .alert-light.border {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ===========================================
   Выбор сервера
   =========================================== */

#serverSelect {
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#serverSelect:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.25);
}

#serverSelect option {
    color: #333;
    background: #fff;
}

/* ===========================================
   Live Timing таблица
   =========================================== */

#onlineDriversTable {
    font-size: 0.85rem;
}

#onlineDriversTable th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    padding: 0.5rem 0.4rem;
}

#onlineDriversTable td {
    padding: 0.4rem;
    vertical-align: middle;
}

/* Delta цвета уже определены через Bootstrap классы text-success/text-danger */

/* Цветной индикатор водителя (синхронизирован с картой) */
#onlineDriversTable td:first-child {
    white-space: nowrap;
}

.driver-color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Компактный вид на мобильных */
@media (max-width: 767px) {
    #onlineDriversTable {
        font-size: 0.8rem;
    }

    #onlineDriversTable th,
    #onlineDriversTable td {
        padding: 0.3rem 0.25rem;
    }
}

/* ===========================================
   Live Session блок
   =========================================== */

#liveServerName,
#liveTrackName {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#sessionTimeLeft {
    font-size: 1.1rem;
}

/* Прогресс-бар сессии */
#sessionProgress {
    transition: width 1s linear;
}

/* ===========================================
   Контент сервера (автомобили)
   =========================================== */

.car-content-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.car-content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.car-content-card img {
    transition: opacity 0.2s ease;
}

/* Dark mode для карточек контента */
[data-bs-theme="dark"] .car-content-card,
[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .car-content-card .bg-secondary {
    background-color: rgba(255, 255, 255, 0.1) !important;
}
