/* Базовые стили в стиле потоковых сервисов */

:root {
    --bg-primary: #141414;
    --bg-secondary: #1a1a1a;
    --bg-hover: #2a2a2a;

    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-tertiary: #666666;

    --accent-primary: #e50914;
    --accent-hover: #f40612;

    --border: #333333;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.nflix-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: #141414;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 48px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #e50914 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.85;
}

.header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-nav a {
    color: #b3b3b3;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
    position: relative;
}

.header-nav a:hover {
    color: #e5e5e5;
}

.header-nav a.active {
    color: #ffffff;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.icon-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.icon-btn:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(229, 9, 20, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.user-avatar:hover {
    border-color: #e50914;
    transform: scale(1.05);
}

/* Balance / Shop button */
.nflix-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 237, 78, 0.15) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nflix-balance:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 237, 78, 0.25) 100%);
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

.nflix-balance span {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nflix-balance img {
    width: 20px;
    height: 20px;
}

/* Main content container - unified for all pages */
.nflix-main-content {
    min-height: calc(100vh - 70px - 60px); /* viewport - header - footer */
    padding: 70px 48px 0 48px;
}

/* Legacy support - same padding for all pages */
.main-content {
    padding-top: 70px;
}

.browse-content {
    padding: 70px 48px 0 48px;
}

/* Sections container */
.sections-container {
    padding: 10px 0;
}

/* Footer */
.nflix-footer {
    background: #0a0a0a;
    padding: 24px 48px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nflix-footer p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 14px;
}

.nflix-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.nflix-footer a:hover {
    color: var(--text-primary);
}

/* MOBILE - адаптация для малых экранов */
@media (max-width: 768px) {
    .nflix-header {
        padding: 0 10px;
        height: 48px;
    }

    .logo {
        font-size: 18px;
    }

    .header-nav {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    .icon-btn {
        font-size: 15px;
        padding: 3px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .nflix-balance {
        padding: 4px 10px;
        border-radius: 14px;
        gap: 4px;
    }

    .nflix-balance span {
        font-size: 12px;
    }

    .nflix-balance img {
        width: 14px;
        height: 14px;
    }

    /* Placeholder для селектора игр */
    .logo {
        display: none;
    }

    .game-selector-placeholder {
        width: 32px;
    }

    .nflix-main-content,
    .browse-content {
        padding: 48px 10px 0 10px;
    }

    .main-content {
        padding-top: 48px;
    }

    .sections-container {
        padding: 10px 0;
    }

    .nflix-footer {
        padding: 16px 10px;
        font-size: 12px;
    }
}

/* DESKTOP - увеличиваем размеры */
@media (min-width: 769px) {
    .nflix-main-content,
    .browse-content {
        padding: 70px 48px 0 48px;
    }

    .main-content {
        padding-top: 70px;
    }

    .sections-container {
        padding: 24px 0;
    }

    .header-nav a {
        font-size: 16px;
    }

    .logo {
        font-size: 28px;
        display: block;
    }

    /* Скрываем placeholder на десктопе */
    .game-selector-placeholder {
        display: none;
    }

    .icon-btn {
        font-size: 22px;
    }
}

/* Improved typography */
body {
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

p {
    color: #e0e0e0;
}

/* Utility classes */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Mobile-only / Desktop-only utilities */
.mobile-only {
    display: none;
}

.mobile-hidden {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }

    .mobile-hidden {
        display: none !important;
    }

    /* Bottom Navigation for mobile */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a1a1a;
        border-top: 1px solid #333;
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        z-index: 100;
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        color: #888;
        font-size: 10px;
        padding: 4px 12px;
        transition: color 0.2s;
    }

    .bottom-nav a.active {
        color: #e50914;
    }

    .bottom-nav-icon {
        font-size: 20px;
    }
}

/* ============================================
   FILTER BAR STYLES
   ============================================ */

/* Filter bar в header */
.header-filter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 32px 8px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 160px;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-select.active {
    border-color: var(--accent-primary);
    background-color: rgba(229, 9, 20, 0.1);
}

.filter-select option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Поиск в header */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}

.header-search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px 8px 36px;
    color: #fff;
    font-size: 14px;
    width: 200px;
    transition: all 0.2s ease;
}

.header-search-input::placeholder {
    color: #999;
}

.header-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    width: 260px;
}

.header-search-icon {
    position: absolute;
    left: 10px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* Кнопка сброса фильтра */
.filter-reset-btn {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    border-radius: 6px;
    padding: 8px 14px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-reset-btn:hover {
    background: rgba(229, 9, 20, 0.25);
    border-color: var(--accent-primary);
}

/* Баннер активного фильтра */
.filter-active-banner {
    display: none;
    background: linear-gradient(135deg, var(--accent-primary), #c850c0);
    color: white;
    padding: 10px 20px;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

.filter-active-banner.visible {
    display: flex;
}

.filter-active-banner .filter-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-active-banner .clear-filter {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
    text-decoration: none;
}

.filter-active-banner .clear-filter:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Сетка отфильтрованных персонажей */
.filtered-results {
    padding: 20px 0;
}

.filtered-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.filtered-results-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtered-results-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.filtered-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.filtered-grid .character-card {
    flex: 0 0 200px;
    max-width: 200px;
}

.filtered-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.filtered-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Mobile filter styles */
@media (max-width: 768px) {
    .header-filter {
        display: none;
    }
}

/* Desktop: скрываем mobile filter bar */
@media (min-width: 769px) {
    .mobile-filter-bar {
        display: none !important;
    }
}

    .mobile-filter-bar::-webkit-scrollbar {
        display: none;
    }

    .mobile-filter-select {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        padding: 6px 28px 6px 12px;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mobile-filter-select.active {
        border-color: var(--accent-primary);
        background-color: rgba(229, 9, 20, 0.2);
    }

    .mobile-search-input {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        padding: 6px 12px;
        color: #fff;
        font-size: 13px;
        flex: 1;
        min-width: 120px;
    }

    .mobile-search-input::placeholder {
        color: #999;
    }

    .mobile-filter-reset {
        background: rgba(229, 9, 20, 0.2);
        border: 1px solid var(--accent-primary);
        border-radius: 20px;
        padding: 6px 12px;
        color: #fff;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        white-space: nowrap;
        flex-shrink: 0;
        text-decoration: none;
    }

    /* Mobile filtered grid */
    .filtered-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 0 4px;
    }

    .filtered-results-header {
        padding: 0 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .filtered-results-title {
        font-size: 16px;
    }
}

/* ============================================
   Battle Pass menu indicators
   — red dot badge when player has unclaimed rewards
   — soft pulse when season started within last 7 days
   Added 2026-04-19 for Season 3 launch (Весенняя Любовь)
   ============================================ */
.bp-menu-badge {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    background: #e50914;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(229, 9, 20, 0.75);
    vertical-align: middle;
    animation: bpMenuBadgePulse 1.6s ease-in-out infinite;
}

@keyframes bpMenuBadgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.15); }
}

.bp-menu-pulse {
    position: relative;
    animation: bpMenuItemPulse 2.4s ease-in-out infinite;
}

@keyframes bpMenuItemPulse {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    50% {
        background-color: rgba(229, 9, 20, 0.12);
        box-shadow: inset 0 0 0 1px rgba(229, 9, 20, 0.35);
    }
}

/* Компактный таймер «13д / 2 нед» рядом с кнопкой Battle Pass.
   Приглушённый серый по умолчанию, красный при <= 3 дней (urgent). */
.bp-menu-timer {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #a5a5b5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.bp-menu-timer.urgent {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
    animation: bpTimerUrgent 1.4s ease-in-out infinite;
}
@keyframes bpTimerUrgent {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50%      { box-shadow: 0 0 10px rgba(239, 68, 68, 0.55); }
}
