/* === Исследование — стили === */

.research-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    position: relative;
}

.research-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc3545, #ffc107, #198754);
}

/* Круг индекса */
.road-index-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.15);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.road-index-circle::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: #ffc107;
    border-right-color: #ffc107;
    transform: rotate(30deg);
}

.index-value {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    color: #ffc107;
}

.index-label {
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Карточки исследования */
.research-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.research-card.border-dashed {
    border: 2px dashed #dee2e6;
    box-shadow: none;
}

.research-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.research-card-body {
    padding: 1.25rem;
    flex: 1;
}

/* Элемент рейтинга */
.rating-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

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

.rating-item:hover {
    background: #f8f9fa;
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.rating-position {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.rating-position.gold {
    background: #ffc107;
    color: #000;
}

.rating-position.silver {
    background: #adb5bd;
    color: #fff;
}

.rating-position.bronze {
    background: #cd7f32;
    color: #fff;
}

.rating-position.default {
    background: #e9ecef;
    color: #495057;
}

/* Факт-карточки */
.fact-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    height: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.fact-card.fact-oldest::before { background: #dc3545; }
.fact-card.fact-voted::before { background: #ffc107; }
.fact-card.fact-hero::before { background: #0d6efd; }
.fact-card.fact-area::before { background: #6f42c1; }

.fact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.fact-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

/* Столбчатая диаграмма по месяцам */
.monthly-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 0 0.5rem;
    gap: 4px;
}

.month-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.month-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 160px;
}

.month-bar {
    width: 18px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.5s ease;
    position: relative;
}

.month-bar:hover {
    opacity: 0.8;
}

.month-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    margin-bottom: 4px;
}

.month-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 6px;
    font-weight: 500;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* Индекс-бар района */
.district-index-bar {
    height: 32px;
    border-radius: 6px;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.district-index-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    transition: width 0.6s ease;
}

/* Среднее время */
.time-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.time-stat:last-child {
    border-bottom: none;
}

.time-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Категории — горизонтальные бары */
.category-bar-container {
    margin-bottom: 1rem;
}

.category-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.category-bar {
    height: 24px;
    border-radius: 6px;
    background: #f0f0f0;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .road-index-circle {
        width: 110px;
        height: 110px;
    }

    .index-value {
        font-size: 2.2rem;
    }

    .month-bar {
        width: 12px;
    }

    .monthly-chart {
        height: 150px;
    }
}
