/* =========================================
   СТРАНИЦА СЕРИЙ — ПЕРЕРАБОТАННЫЙ ДИЗАЙН
   В стиле криминальной драмы из первого проекта
   ========================================= */

/* Импорт шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@500;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Кастомные свойства из первого проекта */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-card: #141414;
    --accent: #e63946;
    --accent-glow: rgba(230, 57, 70, 0.15);
    --text-primary: #f1faee;
    --text-secondary: #a8a8a8;
    --text-muted: #6c757d;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(230, 57, 70, 0.25);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 25px var(--accent-glow);
    --font-primary: 'Inter', 'Roboto', sans-serif;
    --font-display: 'Oswald', 'Impact', sans-serif;
    --transition-fast: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Виньетка */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Шумовая текстура */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* Линии сканирования */
.scan-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9997;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    opacity: 0.4;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    position: relative;
    z-index: 2;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff4757;
}

/* === НАВБАР === */
.navbar {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(10, 10, 10, 0.6);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
}

.logo::before {
    content: '⬤';
    font-size: 8px;
    color: var(--accent);
    animation: blink-record 2s infinite;
}

.logo span {
    color: var(--accent);
    position: relative;
}

.logo span::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform-origin: left;
    animation: underline-scan 3s infinite;
}

@keyframes blink-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes underline-scan {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(0.5); }
}

.back-link {
    font-family: var(--font-display);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}



.back-link:hover {
    color: var(--accent);
}

/* === СЕТКА: ПЛЕЕР + ПЛЕЙЛИСТ === */
.main-view-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
    margin-bottom: 30px;
}

/* Плеер */
.player-section {
    width: 100%;
}

.player-wrapper {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-accent);
    box-shadow: 0 0 40px var(--accent-glow);
    background: #080808;
    height: 0;
    padding-bottom: 56.25%;
    transition: var(--transition-smooth);
}

/* Градиентная полоса над плеером */
.player-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    z-index: 4;
}

.player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Сайдбар с эпизодами */
.episodes-sidebar {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    max-height: 0;
    min-height: 100%;
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--accent);
    opacity: 0.5;
}

.sidebar-header span {
    color: var(--accent);
    font-size: 13px;
}

/* Скролл-список */
.ep-list-scroll {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
}

.ep-list-scroll::-webkit-scrollbar {
    width: 4px;
}

.ep-list-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* Элемент списка */
.ep-list-item {
    display: block;
    padding: 14px 16px;
    border-radius: var(--border-radius-md);
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition-fast);
    position: relative;
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Индикатор активного эпизода */
.ep-list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background: transparent;
    transition: var(--transition-fast);
}

.ep-list-item:hover {
    border-color: var(--border-accent);
    background: rgba(230, 57, 70, 0.05);
    color: var(--text-primary);
    transform: translateX(3px);
}

.ep-list-item:hover::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.ep-list-item.active {
    border-color: var(--accent);
    background: rgba(230, 57, 70, 0.1);
    color: var(--text-primary);
}

.ep-list-item.active::before {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
}

.ep-list-item .ep-num {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    font-family: var(--font-display);
    margin-bottom: 4px;
}

/* Блок информации об эпизоде */
.episode-info-block {
    margin-top: 25px;
    max-width: 1000px;
    padding-left: 20px;
    border-left: 3px solid var(--accent);
}

.episode-label {
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-weight: 700;
}

.episode-info-block h1 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.episode-info-block h1 span {
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.description p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 14px;
    font-weight: 400;
}

/* === АДАПТИВ === */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .main-view-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .episodes-sidebar {
        min-height: auto;
        max-height: 400px;
    }

    .episode-info-block {
        margin-top: 20px;
    }

    .episode-info-block h1 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }

    .logo {
        font-size: 22px;
    }

    .ep-list-item {
        padding: 12px 14px;
        font-size: 13px;
    }

    .description p {
        font-size: 13px;
    }
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.player-wrapper,
.episodes-sidebar,
.episode-info-block {
    animation: fadeInUp 0.6s ease forwards;
}
