/* ==========================================================================
   ОГЛАВЛЕНИЕ
   1. Шрифты и Анимации
   2. Навигация по странам
   3. Контейнер и Карточки песен
   4. Информация о песне и Ссылки
   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;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glowShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================================================
   2. НАВИГАЦИЯ ПО СТРАНАМ
   ========================================================================== */
.country-page {
    animation: fadeIn 0.6s ease;
}

.country-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    padding: 20px 32px;
    background: var(--bg-card); /* Было: rgba(20, 20, 40, 0.6) */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-width: 140px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--accent-purple);
    background: var(--bg-tab);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--bg-hover);
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateY(-2px);
}

.nav-btn .arrow {
    font-size: 18px;
    font-weight: 700;
}

.nav-btn.disabled {
    visibility: hidden;
    pointer-events: none;
}

.country-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    margin: 0;
    background: var(--gradient-primary); /* Было: linear-gradient(...) */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
}

/* ==========================================================================
   3. КОНТЕЙНЕР И КАРТОЧКИ ПЕСЕН
   ========================================================================== */
.songs-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.song-card {
    position: relative;
    background: var(--bg-card); /* Было: rgba(18, 18, 32, 0.95) */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.song-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow-card);
    transform: translateX(4px);
}

/* Неоновая рамка при наведении */
.card-glow {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    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;
    transition: opacity 0.3s ease;
}

.song-card:hover .card-glow {
    opacity: 0.4;
}

/* Год выпуска */
.song-year {
    font-family: 'Rajdhani', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 70px;
    text-align: center;
    background: var(--bg-hover); /* Было: rgba(120, 0, 255, 0.15) */
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-hover);
    transition: all 0.3s ease;
}

/* ==========================================================================
   4. ИНФОРМАЦИЯ О ПЕСНЕ И ССЫЛКИ
   ========================================================================== */
.song-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Критично для корректной работы text-overflow */
}

.song-artist {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.song-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
	align-self: flex-start; 
}

.song-title.youtube-link {
    color: var(--accent-cyan) !important;
    font-weight: 600;
}

.song-title.youtube-link:hover {
    color: var(--accent-pink) !important;
    text-shadow: 0 0 10px var(--accent-glow);
}

.yt-icon {
    font-size: 12px;
    opacity: 0.7;
}

/* ==========================================================================
   5. ИЗБРАННОЕ (ЗВЕЗДА)
   ========================================================================== */
.song-favorite {
    margin-left: auto;
}

.favorite-star-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/*.favorite-star-wrapper:hover {
    background: var(--bg-hover);
}*/

.favorite-checkbox {
    display: none;
}

.star-icon {
    font-size: 28px;
    color: var(--text-muted); /* Было: rgba(255, 255, 255, 0.3) */
    transition: all 0.3s ease;
}

.favorite-checkbox:checked + .star-icon {
    color: #FFD700; /* Золотой цвет универсален для обеих тем */
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    transform: scale(1.1);
}

/* ==========================================================================
   6. АДАПТИВНОСТЬ (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    .country-nav {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
    }

    .nav-btn {
        width: 100%;
        min-width: auto;
        padding: 12px 16px;
        font-size: 13px;
    }

	    /* ДОБАВИТЬ ЭТОТ БЛОК: */
    .nav-btn.disabled {
        display: none;
    }

    .country-title {
        font-size: 24px;
        order: -1; /* Заголовок всегда сверху на мобильных */
    }

    .songs-container {
        gap: 12px;
    }

    .song-card {
        padding: 16px 18px;
        gap: 14px;
    }

    .song-year {
        font-size: 22px;
        min-width: 55px;
        padding: 6px 12px;
    }

    .song-artist { font-size: 14px; }
    .song-title { font-size: 13px; }
    .star-icon { font-size: 24px; }
}

@media (max-width: 480px) {
    .song-card {
        flex-wrap: wrap;
    }

    .song-year {
        order: 1;
    }

    .song-info {
        order: 2;
        flex: 1 1 calc(100% - 80px); /* Адаптивная ширина под уменьшенный год */
    }

    .song-favorite {
        order: 3;
        margin-left: 0;
    }
}