* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
}

body {
    background: #121320;
    color: #f0f0f0;
    overflow-x: hidden;
    animation: fadeInCentral 0.4s ease-out;
}

@keyframes fadeInCentral {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ---- ГЛАВНЫЙ КОНТЕЙНЕР ---- */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px 64px 32px;
}

/* ===== TOP BAR (шапка) ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 0 24px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 32px;
}

.user-greeting {
    background: #15161e;
    padding: 8px 18px;
    border-radius: 28px;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(135deg, #ff5fa3, #ff2e93, #8b3df0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.user-greeting::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ff5fa3, #8b3df0);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    flex-shrink: 0;
}

/* поисковая строка (длинное поле) */
.search-wrapper {
    flex: 1;
    min-width: 240px;
}

.search-input {
    width: 100%;
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 56px;
    padding: 14px 24px;
    font-size: 1rem;
    color: #f0f0f0;
    transition: all 0.2s ease;
    outline: none;
    font-weight: 400;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
    letter-spacing: -0.2px;
}

.search-input:focus {
    border-color: #8b5cf6;
    background: #1c1d2b;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.logo-icon {
    background: #15161e;
    border-radius: 28px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.logo-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.logo-text {
    background: linear-gradient(135deg, #ff5fa3, #ff2e93, #8b3df0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* ===== БАННЕР ===== */
.hero-banner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 48px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5);
}

.hero-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 400px;
}

/* ===== СЕКЦИЯ КАТЕГОРИЙ ===== */
.categories-section {
    margin-top: 8px;
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    background: linear-gradient(120deg, #ff5fa3, #8b3df0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* стрелочные контролы */
.scroll-controls {
    display: flex;
    gap: 12px;
}

.scroll-btn {
    background: #15161e;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #d0c0ff;
    font-size: 1.6rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.scroll-btn:hover {
    background: #1c1d2b;
    transform: scale(1.02);
    border-color: rgba(139, 92, 246, 0.4);
}

.scroll-btn:active {
    transform: scale(0.96);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* контейнер с прокруткой */
.categories-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #1c1d2b;
    border-radius: 28px;
}

.categories-track::-webkit-scrollbar {
    height: 6px;
}

.categories-track::-webkit-scrollbar-track {
    background: #15161e;
    border-radius: 12px;
}

.categories-track::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 12px;
}

.categories-flex {
    display: flex;
    gap: 22px;
    padding: 6px 4px 20px 4px;
}

.categories-flex:empty {
    min-height: 132px;
    background: linear-gradient(90deg, #1c1d2b 25%, #232439 50%, #1c1d2b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 24px;
}

.category-card {
    position: relative;
    width: 220px;
    aspect-ratio: 5 / 3;
    flex-shrink: 0;
    border-radius: 24px;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #1c1d2b, #2a1e3c, #15161e);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 25px -15px rgba(0, 0, 0, 0.6);
}

.category-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.category-card:hover .category-img {
    transform: scale(1.05);
}

.category-hero {
    margin-bottom: 40px;
    padding: 28px 30px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(28, 29, 43, 0.24), rgba(21, 22, 30, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.category-hero-inner {
    max-width: 920px;
}

.category-badge,
.movie-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: #d0c0ff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}

.category-hero h1,
.movie-detail-info h1 {
    font-size: clamp(2rem, 3vw, 3.2rem);
    margin: 0 0 14px;
    line-height: 1.05;
}

.category-hero p,
.movie-detail-info p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.75;
    font-size: 1rem;
}

.movies-section {
    margin-bottom: 48px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

@media (min-width: 1200px) {
    .movies-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.movie-card {
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 26px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.5);
}

.movie-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.25s ease;
}

.movie-cover:hover {
    transform: scale(1.03);
}

.movie-card-body {
    padding: 20px;
}

.movie-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: #f0f0f0;
}

.movie-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin-bottom: 10px;
}

.movie-rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.movie-rating span {
    color: #d0c0ff;
}

.movie-detail-page {
    padding: 20px 0 60px;
}

.movie-detail-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
    align-items: start;
    padding: 32px;
    border-radius: 28px;
    background: rgba(21, 22, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 26px 45px rgba(0, 0, 0, 0.28);
}

.movie-detail-cover {
    width: 100%;
    border-radius: 24px;
    object-fit: cover;
}

.movie-detail-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.movie-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 22px;
    border-radius: 999px;
    background: #8b5cf6;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: #9b6cf7;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #d0c0ff;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 980px) {
    .movie-detail-card {
        grid-template-columns: 1fr;
    }
}

.episodes-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.episode-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 96px;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(21, 22, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.episode-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    font-weight: 700;
}

.episode-title {
    color: #f0f0f0;
    font-weight: 600;
}

.episode-duration {
    color: rgba(255, 255, 255, 0.45);
    text-align: right;
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .episode-row {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }

    .episode-duration {
        text-align: left;
    }
}

@media (max-width: 780px) {
    .app-container {
        padding: 0 20px 48px 20px;
    }
    .top-bar {
        gap: 16px;
    }
    .user-greeting {
        padding: 6px 16px;
        font-size: 0.9rem;
    }
    .logo-icon {
        padding: 6px 14px;
    }
    .logo-icon img {
        width: 26px;
        height: 26px;
    }
    .section-header h2 {
        font-size: 1.4rem;
    }
    .category-card {
        width: 190px;
    }
}

@media (max-width: 560px) {
    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .search-wrapper {
        order: 3;
        width: 100%;
        margin-top: 8px;
    }
    .category-card {
        width: 170px;
    }
}

.profile-section {
    margin-top: 32px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.profile-card,
.profile-logout-card {
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
}

.profile-card h3,
.profile-logout-card h3 {
    margin-bottom: 18px;
    color: #f0f0f0;
}

.profile-card label {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-card input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1c1d2b;
    color: #f0f0f0;
    margin-bottom: 18px;
}

.profile-card button {
    width: auto;
}

.profile-logout-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.profile-logout-card p {
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== PROFILE HERO ===== */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 40px;
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    padding: 32px 36px;
}

.profile-hero-avatar {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #3b9eff);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}

.profile-hero-info {
    flex: 1;
    min-width: 0;
}

.profile-hero-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #ff5fa3, #ff2e93, #8b3df0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.profile-hero-email {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== MY SERIES SECTION ===== */
.my-series-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 20px;
    background: linear-gradient(120deg, #ff5fa3, #8b3df0);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.my-series-track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8b5cf6 #1c1d2b;
    border-radius: 28px;
    margin-bottom: 48px;
}

.my-series-track::-webkit-scrollbar {
    height: 6px;
}

.my-series-track::-webkit-scrollbar-track {
    background: #15161e;
    border-radius: 12px;
}

.my-series-track::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 12px;
}

.my-series-flex {
    display: flex;
    gap: 18px;
    padding: 6px 4px 20px 4px;
}

.my-series-flex:empty {
    min-height: 240px;
    background: linear-gradient(90deg, #1c1d2b 25%, #232439 50%, #1c1d2b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 20px;
}

.my-series-card {
    flex: 0 0 auto;
    width: 170px;
    border-radius: 20px;
    cursor: pointer;
    background: #15161e;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.my-series-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 25px -15px rgba(0, 0, 0, 0.6);
}

.my-series-card-img {
    width: 100%;
    aspect-ratio: 2 / 1.2;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.my-series-card:hover .my-series-card-img {
    transform: scale(1.03);
}

.my-series-card-label {
    padding: 10px 14px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    color: #f0f0f0;
}

.my-series-add {
    flex: 0 0 auto;
    width: 170px;
    border-radius: 20px;
    cursor: pointer;
    background: #15161e;
    overflow: hidden;
    border: 1px dashed rgba(139, 92, 246, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.my-series-add:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 20px 25px -15px rgba(0, 0, 0, 0.6);
    background: #1c1d2b;
}

.my-series-add .add-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #8b5cf6, #3b9eff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 6px;
}

.my-series-add .add-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 780px) {
    .profile-hero {
        padding: 24px 20px;
        gap: 20px;
    }
    .profile-hero-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .profile-hero-name {
        font-size: 1.4rem;
    }
    .my-series-card,
    .my-series-add {
        width: 140px;
    }
}

@media (max-width: 560px) {
    .my-series-card,
    .my-series-add {
        width: 120px;
    }
    .my-series-flex {
        gap: 12px;
    }
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.series-grid:empty {
    min-height: 350px;
    background: linear-gradient(90deg, #1c1d2b 25%, #232439 50%, #1c1d2b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 26px;
}

.series-card {
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 26px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.series-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px -14px rgba(0, 0, 0, 0.5);
}

.series-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.series-card-info {
    padding: 12px 14px;
}

.series-card .title {
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 4px;
}

.series-card .desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.series-card .rating {
    font-size: 13px;
    color: #ff5fa3;
}

.search-section {
    margin-top: 8px;
    margin-bottom: 48px;
}

.results-count {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    font-size: 1rem;
}

.no-results {
    text-align: center;
    padding: 60px 40px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.1rem;
    background: #15161e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
}

.loading {
    text-align: center;
    padding: 60px 40px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.1rem;
}

.search-btn-large {
    padding: 14px 24px;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 56px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.search-btn-large:hover {
    background: #9b6cf7;
}
