/* ==========================================================================
   ОГЛАВЛЕНИЕ
   1. Шрифты и Анимации
   2. Заголовок страницы
   3. Меню-кнопки (ПФ1 / ПФ2 / Финал)
   4. Таблица (Основа и Ячейки)
   5. Ширина колонок
   6. Элементы управления (YouTube, Избранное)
   7. Адаптивность (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;
}

@keyframes btnGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================================================
   2. ЗАГОЛОВОК СТРАНИЦЫ
   ========================================================================== */
.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.page-header .note {
    color: #ff4466; /* Оставляем как акцентный цвет предупреждения */
    font-weight: 600;
    font-size: 14px;
}

/* ==========================================================================
   3. МЕНЮ-КНОПКИ
   ========================================================================== */
.menu-container {
    display: flex;
    justify-content: center;
    margin: 24px 0 32px;
    gap: 12px;
    flex-wrap: wrap;
}

.menu-button {
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--accent-purple);
    color: var(--text-secondary);
    background: var(--bg-tab);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.menu-button:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
    box-shadow: 0 0 25px var(--accent-glow);
}

.menu-button.active {
    color: #ffffff;
    background: var(--bg-tab-active);
    background-size: 200% 200%;
    animation: btnGlow 4s ease infinite;
    border-color: transparent;
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ==========================================================================
   4. ТАБЛИЦА
   ========================================================================== */
.eurovision-table {
    /* Упрощенное и надежное центрирование вместо transform hack */
    width: 80vw;
    max-width: 1200px;
    margin: 24px auto 48px;
    
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    table-layout: fixed;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

/* Заголовки и сортируемые ячейки */
.table-header th,
.sortable-row td {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    /*font-size: 11px;*/
    letter-spacing: 1px;
    padding: 16px 6px;
    text-align: center;
    border-bottom: 2px solid var(--accent-purple);
    font-family: 'Rajdhani', sans-serif;
}

.table-header th{
	font-size: 11px;
}

.sortable-row td {
    cursor: pointer;
    transition: background 0.3s ease;
}

.sortable-row td:hover {
    background: rgba(120, 0, 255, 0.3); /* Оставляем фиолетовый ховер для сортировки */
}

/* Обычные ячейки */
.eurovision-table td {
    padding: 14px 4px;
    text-align: center;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Чередование строк */
.eurovision-table tbody tr:nth-child(even) td {
    background: var(--bg-vote-item);
}

/* Hover-эффект на строке */
.eurovision-table tbody tr:hover td {
    background: rgba(120, 0, 255, 0.12) !important;
    color: #ffffff;
}

.eurovision-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   5. ШИРИНА КОЛОНОК (Сгруппировано)
   ========================================================================== */
.col-ro { width: 50px; min-width: 50px; font-size: 14px;}
.col-country { width: 130px; min-width: 130px; font-size: 10px;}
.col-artist, .col-song { width: auto; min-width: 120px; white-space: normal; word-break: break-word; font-size: 12px;}
.col-points, .col-place { width: 80px; min-width: 80px; font-size: 14px;}
.col-watch { width: 90px; min-width: 90px; font-size: 14px;}
.col-fav { width: 80px; min-width: 80px; font-size: 14px;}

/* ==========================================================================
   6. ЭЛЕМЕНТЫ УПРАВЛЕНИЯ
   ========================================================================== */
/* Ссылка YouTube */
.youtube-link {
    color: var(--accent-cyan) !important;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.youtube-link:hover {
    color: var(--accent-pink) !important;
    text-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.1);
}

/* Избранное (звёздочка) */
.favorite-star-wrapper {
    display: inline-block;
    cursor: pointer;
}

.favorite-checkbox {
    display: none;
}

.star-icon::before {
    content: "☆";
    font-size: 28px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.favorite-checkbox:checked + .star-icon::before {
    content: "★";
    color: #FFD700; /* Золотой цвет оставляем жестко, он универсален */
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

.info {
    margin: 2px;
    font-size: 18px;
}

/* ==========================================================================
   7. АДАПТИВНОСТЬ (768px и ниже)
   ========================================================================== */
@media (max-width: 768px) {
    .eurovision-table {
        width: 90vw;
        margin: 24px auto 48px;
        font-size: 13px;
    }

    /* Скрываем лишние колонки на мобильных */
    .col-artist, .col-song, .col-points {
        display: none !important;
    }

    /* Компактные ячейки */
    .table-header th, .sortable-row td, .eurovision-table td {
        padding: 8px 4px !important;
    }

    /* Оптимизация видимых колонок */
    .col-ro { width: 26px !important; min-width: 26px !important; }
    .col-country { width: 70px !important; min-width: 70px !important; }
    .col-place { width: 30px !important; min-width: 30px !important; }

    /* "Смотреть" → ▶ */
    th.col-watch, td.col-watch {
        font-size: 0 !important;
        width: 35px !important;
        min-width: 35px !important;
    }
    th.col-watch::after {font-size: 16px; color: #fff; }
    td.col-watch a { font-size: 0; }
    td.col-watch a::after {
        font-size: 16px;
        color: var(--accent-cyan);
        text-decoration: none;
    }

    /* "Избранное" → ★ */
    th.col-fav, td.col-fav {
        font-size: 0 !important;
        width: 35px !important;
        min-width: 35px !important;
    }
    th.col-fav::after { content: "★"; font-size: 16px; color: #fff; }
    .star-icon::before { font-size: 22px; }

    /* Кнопки меню и заголовок */
    .menu-container { gap: 8px; margin: 16px 0 24px; }
    .menu-button { padding: 10px 20px; font-size: 12px; }
    .page-header h1 { font-size: 24px; }
}