/* =========================================
   СТРАНИЦА СТРАН — НЕОНОВЫЙ СТИЛЬ
   ========================================= */

.euro-page {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ЗАГОЛОВОК ===== */
.euro-header {
    text-align: center;
    margin-bottom: 32px;
}

.euro-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    margin: 0 0 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.euro-title-2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 700;
    margin: 22px 0 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.euro-subtitle {
    font-size: clamp(14px, 1.5vw, 17px);
    color: var(--text-secondary);
    margin: 0;
}

/* ===== ТАБЫ ===== */
.euro-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.euro-tab {
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    /* OPTIMIZED: Заменяем 'all' на конкретные свойства */
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--accent-purple);
    color: var(--text-secondary);
    background: var(--bg-tab);
    /* OPTIMIZED: Убираем backdrop-filter. Плотный цвет в var(--bg-tab) справится лучше */
}

.euro-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
    /* OPTIMIZED: Уменьшаем радиус свечения с 25px до 10px */
    box-shadow: 0 0 10px var(--accent-glow);
}

.euro-tab.active {
    color: #ffffff;
    background: var(--bg-tab-active);
    background-size: 200% 200%;
    animation: tabGlow 4s ease infinite;
    border-color: transparent;
    /* OPTIMIZED: Уменьшаем радиус свечения с 30px до 12px */
    box-shadow: 0 0 12px var(--accent-glow);
}

@keyframes tabGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== СЕТКА КАРТОЧЕК ===== */
.euro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* ===== КАРТОЧКА СТРАНЫ ===== */
.country-card {
    position: relative;
    background: var(--bg-card);
    /* OPTIMIZED: УБИРАЕМ backdrop-filter. Критично для сетки из множества карточек! */
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.country-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    /* OPTIMIZED: Двойная тень с радиусами 50px и 40px убита. 
       Уменьшаем до 15px и 12px. Визуально эффект сохраняется. */
    box-shadow: 0 10px 15px var(--shadow-card), 0 0 12px var(--accent-glow);
}

/* Неоновая рамка */
.card-glow {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan), var(--accent-purple), var(--accent-pink));
    background-size: 300% 300%;
    animation: glowShift 6s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes glowShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Флаг страны */
.card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
    background: var(--bg-tab);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.5s ease;
}

.country-card:hover .card-image img {
    transform: scale(1.08);
}

/* Информация */
.card-info {
    padding: 20px;
    text-align: center;
}

.card-country {
    font-family: 'Rajdhani', sans-serif;
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
}

/* =========================================
   МОБИЛЬНАЯ ВЕРСИЯ: КОМПАКТНЫЙ СПИСОК
   ========================================= */
@media (max-width: 768px) {
    /* OPTIMIZED: Жестко отключаем все тяжелые эффекты на мобильных */
    .country-card,
    .euro-tab {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* OPTIMIZED: Отключаем бесконечные анимации градиентов. 
       Они не используют GPU-ускорение и сажают батарею/CPU */
    .euro-tab.active,
    .card-glow {
        animation: none !important;
    }

    .euro-grid {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* Карточка превращается в горизонтальную строку */
    .country-card {
        display: flex;
        align-items: center;
        padding: 10px 14px;
        border-radius: 10px;
        transform: none !important;
        border-color: var(--border-color);
    }

    /* OPTIMIZED: На тач-экранах hover часто "залипает". 
       Убираем трансформации, оставляем только микро-свечение */
    .country-card:hover {
        transform: none !important;
        border-color: var(--border-hover);
        box-shadow: 0 0 8px var(--accent-glow); /* Уменьшили с 15px до 8px */
    }

    /* Убираем неоновую рамку в списке */
    .card-glow {
        display: none;
    }

    /* Маленький флаг слева */
    .card-image {
        width: 36px;
        height: 24px;
        padding: 0;
        flex-shrink: 0;
        background: transparent;
        overflow: visible;
    }

    .card-image img {
        width: 100%;
        height: 100%;
        padding: 0;
        border-radius: 3px;
        object-fit: cover;
        border: 1px solid var(--border-color);
    }

    .country-card:hover .card-image img {
        transform: none;
    }

    /* Информация справа от флага */
    .card-info {
        flex: 1;
        padding: 0 0 0 14px;
        text-align: left;
    }

    .card-country {
        font-size: 15px;
        justify-content: flex-start;
        min-height: auto;
        text-align: left;
    }
}

/* =========================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ
   ========================================= */
@media (max-width: 480px) {
    .country-card {
        padding: 8px 12px;
    }

    .card-image {
        width: 30px;
        height: 20px;
    }

    .card-info {
        padding-left: 10px;
    }

    .card-country {
        font-size: 14px;
    }

    /* Табы друг под другом */
    .euro-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .euro-tab {
        width: 100%;
        padding: 12px 20px;
        text-align: center;
        box-sizing: border-box;
        /* OPTIMIZED: Убираем тени у табов на мелких экранах */
        box-shadow: none;
    }
    
    .euro-tab:hover,
    .euro-tab.active {
        box-shadow: 0 0 8px var(--accent-glow);
    }
}