/* ==========================================================================
   ОГЛАВЛЕНИЕ
   1. Шрифты и Анимации
   2. Заголовок страницы
   3. Табы (Годы)
   4. Карточки результатов (Details/Summary)
   5. Список голосов и пустые состояния
   6. Адаптивность (Media Queries)
   ========================================================================== */

/* ==========================================================================
   1. ШРИФТЫ И АНИМАЦИИ
   ========================================================================== */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/Montserrat-VariableFont_wght.ttf') format('ttf');
  font-display: swap;
}

.results-page {
    animation: fadeIn 0.6s ease;
    max-width: 1200px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tabGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================================================
   2. ЗАГОЛОВОК СТРАНИЦЫ
   ========================================================================== */
.results-header {
    text-align: center;
    margin-bottom: 32px;
}

.results-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary); /* Было: linear-gradient(...) */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.results-subtitle {
    font-size: clamp(14px, 1.5vw, 17px);
    color: var(--text-secondary); /* Было: rgba(255, 255, 255, 0.65) */
    margin: 0;
    transition: color 0.3s ease;
}

/* ==========================================================================
   3. ТАБЫ (ГОДЫ)
   ========================================================================== */
.results-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.results-tab {
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-purple);
    color: var(--gradient-primary);
    background: var(--bg-tab);
    backdrop-filter: blur(10px);
}

.results-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
    box-shadow: 0 0 25px var(--accent-glow);
}

.results-tab.active {
    color: #ffffff;
    background: var(--bg-tab-active); /* Было: linear-gradient(...) */
    background-size: 200% 200%;
    animation: tabGlow 4s ease infinite;
    border-color: transparent;
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ==========================================================================
   4. КАРТОЧКИ РЕЗУЛЬТАТОВ (DETAILS/SUMMARY)
   ========================================================================== */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.country-result {
    background: var(--bg-details); /* Было: rgba(18, 18, 32, 0.95) */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.country-result:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow-card);
}

.country-result summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    cursor: pointer;
    list-style: none;
    /* Сохраняем уникальный градиент, но добавляем плавность */
    background: linear-gradient(135deg, rgba(120, 0, 255, 0.15), rgba(255, 0, 150, 0.15));
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.country-result summary:hover {
    background: linear-gradient(135deg, rgba(120, 0, 255, 0.25), rgba(255, 0, 150, 0.25));
}

/* Скрываем стандартный треугольник во всех браузерах */
.country-result summary::-webkit-details-marker,
.country-result summary::marker {
    display: none;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.result-rank {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted); /* Было: rgba(255, 255, 255, 0.6) */
    min-width: 30px;
    transition: color 0.3s ease;
}

.result-country {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.result-artist {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.avg-badge {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    background: var(--bg-badge); /* Было: linear-gradient(...) */
    padding: 6px 16px;
    border-radius: 50px;
    box-shadow: 0 0 20px var(--accent-glow);
    min-width: 60px;
    text-align: center;
}

/* ==========================================================================
   5. СПИСОК ГОЛОСОВ И ПУСТЫЕ СОСТОЯНИЯ
   ========================================================================== */
.votes-list {
    padding: 20px 24px;
    background: var(--bg-vote-item); /* Было: rgba(255, 255, 255, 0.02) */
    transition: background 0.3s ease;
}

.votes-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.votes-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-card); /* Используем базовый фон карточки для контраста */
    border-radius: 10px;
    border-left: 3px solid var(--border-hover);
    transition: all 0.3s ease;
}

.votes-list li:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.vote-user {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: color 0.3s ease;
}

.vote-points {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-cyan); /* Было: #00ffff */
    transition: color 0.3s ease;
}

.no-votes {
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
    text-align: center;
    padding: 20px;
    transition: color 0.3s ease;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-tab);
    border-radius: 16px;
    border: 1px dashed var(--border-color);
    transition: all 0.3s ease;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
    transition: color 0.3s ease;
}

/* ==========================================================================
   6. АДАПТИВНОСТЬ (768px и ниже)
   ========================================================================== */
@media (max-width: 768px) {
    .results-page {
        padding: 24px 16px 40px;
    }

    .results-tabs {
        gap: 8px;
    }

    .results-tab {
        padding: 10px 20px;
        font-size: 14px;
    }

    .country-result summary {
        padding: 14px 18px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .result-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .result-rank { font-size: 20px; }
    .result-country { font-size: 15px; }
    .result-artist { font-size: 13px; }
    
    .avg-badge {
        font-size: 18px;
        padding: 5px 14px;
    }

    .votes-list {
        padding: 16px 18px;
    }

    .votes-list ul {
        grid-template-columns: 1fr;
    }

    .votes-list li {
        padding: 8px 12px;
    }

    .vote-user { font-size: 13px; }
    .vote-points { font-size: 16px; }
}