/**
 * Стили для страницы RHHCC (Russian Hot Hatch Club Championship)
 */

/* ===========================================
   Переменные и цвета
   =========================================== */

:root {
    --rhhcc-primary: #e63946;
    --rhhcc-secondary: #1d3557;
    --rhhcc-accent: #f1faee;
    --rhhcc-gold: #ffd700;
    --rhhcc-silver: #c0c0c0;
    --rhhcc-bronze: #cd7f32;
}

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

.rhhcc-hero {
    background: linear-gradient(135deg, var(--rhhcc-secondary) 0%, #2a4a6d 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.rhhcc-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(230, 57, 70, 0.2));
    pointer-events: none;
}

.rhhcc-hero .hero-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.rhhcc-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.rhhcc-hero .hero-subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

.rhhcc-hero .hero-badge {
    background: var(--rhhcc-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ===========================================
   Карточки статистики
   =========================================== */

.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.stat-card i {
    color: var(--rhhcc-primary);
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--rhhcc-secondary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

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

[data-bs-theme="dark"] .stat-value {
    color: #fff;
}

[data-bs-theme="dark"] .stat-label {
    color: #adb5bd;
}

/* ===========================================
   Табы сезонов
   =========================================== */

.season-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.season-tabs .nav-link {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--rhhcc-secondary);
    background: #e9ecef;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.season-tabs .nav-link:hover {
    background: #dee2e6;
    color: var(--rhhcc-primary);
    border-color: #ced4da;
}

.season-tabs .nav-link.active {
    background: var(--rhhcc-primary);
    color: #fff;
    border-color: var(--rhhcc-primary);
}

[data-bs-theme="dark"] .season-tabs .nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

[data-bs-theme="dark"] .season-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .season-tabs .nav-link.active {
    background: var(--rhhcc-primary);
    color: #fff;
}

/* ===========================================
   Турнирная таблица
   =========================================== */

.standings-table {
    margin-bottom: 0;
}

.standings-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: 2px solid var(--rhhcc-primary);
    padding: 0.75rem;
}

.standings-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.standings-table tbody tr {
    transition: background-color 0.15s ease;
}

.standings-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.05);
}

/* Позиции в таблице */
.position-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.position-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #5c4a00;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.position-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #4a4a4a;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.position-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
    color: #4a2f00;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

/* Стили таблиц для тёмной темы */
[data-bs-theme="dark"] .standings-table th,
[data-bs-theme="dark"] .results-table th {
    color: #adb5bd;
    border-bottom-color: var(--rhhcc-primary);
}

[data-bs-theme="dark"] .standings-table tbody tr:hover,
[data-bs-theme="dark"] .results-table tbody tr:hover {
    background-color: rgba(230, 57, 70, 0.1);
}

/* Очки */
.points-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--rhhcc-primary);
}

[data-bs-theme="dark"] .points-value {
    color: #ff6b7a;
}

/* Время */
.time-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

[data-bs-theme="dark"] .time-value {
    color: #e9ecef;
}

/* ===========================================
   Подиум топ-3
   =========================================== */

.top-pilots-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem 0;
}

.podium-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease;
    min-width: 180px;
}

.podium-item:hover {
    transform: translateY(-8px);
}

.podium-item.gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px solid #ffd700;
    order: 2;
    padding-bottom: 3rem;
}

.podium-item.silver {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #c0c0c0;
    order: 1;
    padding-bottom: 2rem;
}

.podium-item.bronze {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d4 100%);
    border: 2px solid #cd7f32;
    order: 3;
    padding-bottom: 1.5rem;
}

.podium-position {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.podium-item.gold .podium-position {
    color: #b8860b;
}

.podium-item.silver .podium-position {
    color: #6c757d;
}

.podium-item.bronze .podium-position {
    color: #cd7f32;
}

.podium-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--rhhcc-secondary);
    margin-bottom: 0.25rem;
}

.podium-city {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.podium-stats {
    font-size: 0.85rem;
    color: #6c757d;
}

.podium-points {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--rhhcc-primary);
}

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

[data-bs-theme="dark"] .podium-item.silver {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
}

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

[data-bs-theme="dark"] .podium-name {
    color: #fff;
}

[data-bs-theme="dark"] .podium-city,
[data-bs-theme="dark"] .podium-stats {
    color: #adb5bd;
}

/* ===========================================
   Карточки этапов
   =========================================== */

.stage-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.stage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--rhhcc-primary);
}

.stage-card.active {
    border-color: var(--rhhcc-primary);
    box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.2);
}

.stage-number {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--rhhcc-primary);
    margin-bottom: 0.25rem;
}

.stage-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--rhhcc-secondary);
    margin-bottom: 0.25rem;
}

.stage-track {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.stage-date {
    font-size: 0.8rem;
    color: #adb5bd;
}

.stage-results-count {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

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

[data-bs-theme="dark"] .stage-name {
    color: #fff;
}

[data-bs-theme="dark"] .stage-number {
    color: #ff6b7a;
}

[data-bs-theme="dark"] .stage-track,
[data-bs-theme="dark"] .stage-date,
[data-bs-theme="dark"] .stage-results-count {
    color: #adb5bd;
}

/* ===========================================
   Табы классов
   =========================================== */

.class-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: none;
    margin-bottom: 1rem;
}

.class-tabs .nav-link {
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    background: #e9ecef;
    border: 1px solid #dee2e6;
}

.class-tabs .nav-link:hover {
    background: #dee2e6;
    color: var(--rhhcc-secondary);
    border-color: #ced4da;
}

.class-tabs .nav-link.active {
    background: var(--rhhcc-secondary);
    color: #fff;
}

[data-bs-theme="dark"] .class-tabs .nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: #adb5bd;
}

[data-bs-theme="dark"] .class-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

[data-bs-theme="dark"] .class-tabs .nav-link.active {
    background: var(--rhhcc-primary);
    color: #fff;
}

/* ===========================================
   Результаты этапа
   =========================================== */

.results-table {
    font-size: 0.9rem;
}

.results-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #6c757d;
    padding: 0.5rem;
}

.results-table td {
    padding: 0.5rem;
    vertical-align: middle;
}

.results-table .pilot-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.results-table .pilot-link:hover {
    color: var(--rhhcc-primary);
}

[data-bs-theme="dark"] .pilot-link {
    color: #e9ecef;
}

[data-bs-theme="dark"] .pilot-link:hover {
    color: var(--rhhcc-primary);
}

/* ===========================================
   Профиль пилота (модальное окно)
   =========================================== */

.pilot-profile-header {
    background: linear-gradient(135deg, var(--rhhcc-secondary) 0%, #2a4a6d 100%);
    color: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    margin: -1rem -1rem 1rem -1rem;
}

.pilot-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.pilot-profile-city {
    opacity: 0.8;
    font-size: 0.9rem;
}

.pilot-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pilot-stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.pilot-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rhhcc-primary);
}

.pilot-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
}

[data-bs-theme="dark"] .pilot-stat-item {
    background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .pilot-stat-label {
    color: #adb5bd;
}

/* ===========================================
   Поиск пилотов
   =========================================== */

.pilot-search-container {
    position: relative;
}

.pilot-search-input {
    padding-left: 2.5rem;
}

.pilot-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.pilot-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none;
}

.pilot-search-results.show {
    display: block;
}

.pilot-search-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pilot-search-item:hover {
    background: rgba(230, 57, 70, 0.05);
}

.pilot-search-item:last-child {
    border-bottom: none;
}

[data-bs-theme="dark"] .pilot-search-results {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .pilot-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ===========================================
   Скелетон загрузки
   =========================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-card {
    height: 100px;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* ===========================================
   Пустые состояния
   =========================================== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--rhhcc-secondary);
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .empty-state {
    color: #adb5bd;
}

[data-bs-theme="dark"] .empty-state h5 {
    color: #e9ecef;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

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

@media (max-width: 992px) {
    .top-pilots-podium {
        flex-direction: column;
        align-items: center;
    }

    .podium-item {
        order: unset !important;
        width: 100%;
        max-width: 300px;
        padding-bottom: 1.5rem !important;
    }

    .podium-item.gold {
        order: 0 !important;
    }

    .pilot-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rhhcc-hero {
        padding: 2rem 1rem;
    }

    .rhhcc-hero h1 {
        font-size: 1.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .season-tabs .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .standings-table th,
    .standings-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Скрываем второстепенные колонки */
    .standings-table .hide-mobile {
        display: none;
    }
}

@media (max-width: 576px) {
    .rhhcc-hero .hero-logo {
        max-width: 80px;
    }

    .rhhcc-hero h1 {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .podium-item {
        min-width: unset;
        padding: 1rem;
    }

    .podium-position {
        font-size: 2rem;
    }

    .stage-card {
        padding: 0.75rem;
    }

    .pilot-stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .pilot-stat-item {
        padding: 0.75rem;
    }

    .pilot-stat-value {
        font-size: 1.25rem;
    }
}

/* ===========================================
   Страница профиля пилота
   =========================================== */

.rhhcc-pilot-hero {
    background: linear-gradient(135deg, var(--rhhcc-secondary) 0%, #2a4a6d 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.rhhcc-pilot-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.pilot-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pilot-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.season-year {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--rhhcc-primary);
}

[data-bs-theme="dark"] .rhhcc-pilot-hero {
    background: linear-gradient(135deg, #1a2d42 0%, #0d1b2a 100%);
}

[data-bs-theme="dark"] .pilot-avatar {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Бейджи достижений */
.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.achievement-badge i {
    font-size: 1rem;
}

.achievement-badge.gold {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    color: #5c4a00;
    border: 1px solid #ffd700;
}

.achievement-badge.silver {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #4a4a4a;
    border: 1px solid #c0c0c0;
}

.achievement-badge.bronze {
    background: linear-gradient(135deg, #fff5eb 0%, #ffe8d4 100%);
    color: #4a2f00;
    border: 1px solid #cd7f32;
}

.achievement-badge.info {
    background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
    color: #1864ab;
    border: 1px solid #74c0fc;
}

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

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

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

[data-bs-theme="dark"] .achievement-badge.info {
    background: linear-gradient(135deg, #1a3a5c 0%, #0d2840 100%);
    color: #74c0fc;
}

/* Accordion истории */
.accordion-button:not(.collapsed) {
    background-color: rgba(230, 57, 70, 0.05);
    color: inherit;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(230, 57, 70, 0.25);
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: rgba(230, 57, 70, 0.1);
}

/* Адаптивность профиля */
@media (max-width: 768px) {
    .rhhcc-pilot-hero {
        padding: 1.5rem;
    }

    .pilot-avatar {
        width: 60px;
        height: 60px;
    }

    .pilot-avatar i {
        font-size: 1.5rem !important;
    }

    .pilot-name {
        font-size: 1.5rem;
    }

    .achievement-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 576px) {
    .rhhcc-pilot-hero {
        padding: 1rem;
    }

    .pilot-avatar {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem !important;
    }

    .pilot-name {
        font-size: 1.25rem;
    }

    .season-year {
        font-size: 1rem;
    }
}
