.content-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* --- HERO SLIDER --- */
.hero-container {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 20px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* 1. Background */
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    filter: blur(10px) brightness(0.5);
    /* Сильное размытие и затемнение */
    transform: scale(1.1);
    z-index: 1;
}

/* 2. Gradient Overlay for Text Readability */
.hero-overlay-gradient {
    position: absolute;
    inset: 0;
    /* Градиент слева направо: темный под текстом, прозрачный над фоном */
    background: linear-gradient(90deg, #09090b 0%, rgba(9, 9, 11, 0.85) 45%, rgba(9, 9, 11, 0.2) 100%);
    z-index: 2;
}

/* 3. Content Container */
.hero-content {
    position: relative;
    z-index: 3;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 40px;
    gap: 40px;
}

/* Left: Poster */
.hero-poster-box {
    flex-shrink: 0;
    width: 260px;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    opacity: 0;
    transition: 0.6s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide.active .hero-poster-box {
    transform: translateY(0);
    opacity: 1;
}

/* Right: Info */
.hero-info-box {
    flex: 1;
    color: #fff;
    padding-right: 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: 0.6s 0.3s ease;
}

.hero-slide.active .hero-info-box {
    transform: translateY(0);
    opacity: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #d4d4d8;
    margin-bottom: 30px;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #000;
    padding: 12px 32px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.2s;
}

.btn-watch:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--primary-glow);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
    /* Расстояние между цифрами */
}

/* Navigation */
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.hero-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.hero-nav.prev {
    left: 20px;
}

.hero-nav.next {
    right: 20px;
}

.hero-dots {
    position: absolute;
    bottom: 25px;
    right: 40px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* --- HISTORY, HEADER, GRID --- */
.history-section {
    margin-bottom: 50px;
}

.section-header {
    margin-bottom: 20px;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.history-shelf {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 10px 4px 20px 4px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.history-shelf::-webkit-scrollbar {
    display: none;
}

.history-card {
    flex: 0 0 260px;
    min-width: 260px;
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.2s ease;
}

.h-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.h-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.3s;
}

.history-card:hover .h-poster img {
    transform: scale(1.05);
}

.history-card:hover .h-overlay {
    opacity: 1;
}

.h-title {
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
}

.play-svg-mini {
    width: 32px;
    height: 32px;
    color: #fff;
}

.h-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
}

.bar-fill {
    height: 100%;
    background: var(--primary);
}

.h-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.page-header {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.header-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.page-header p {
    color: var(--text-sec);
    margin: 0 0 0 38px;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.anime-card {
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.2s;
}

.anime-card:hover {
    transform: translateY(-5px);
}

.poster-wrapper {
    aspect-ratio: 2/3;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--surface);
}

.poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.anime-card:hover .poster-wrapper img {
    transform: scale(1.08);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
}

.anime-card:hover .card-overlay {
    opacity: 1;
}

.play-button {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transform: scale(0.8);
    transition: 0.2s;
}

.anime-card:hover .play-button {
    transform: scale(1);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 10px;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.anime-card:hover .card-title {
    color: var(--primary);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-sec);
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.page-btn,
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s;
    font-weight: 600;
}

.page-btn:hover,
.page-num:hover {
    background: var(--surface-hover);
}

.page-num.active {
    background: var(--primary);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}


/* ========================================= */
/* === MEDIA QUERIES (ADAPTATION) === */
/* ========================================= */

/* LAPTOPS (1024px to 1400px) - Scaling down to fit screen */
@media (max-width: 1400px) {
    .hero-container {
        height: 420px;
    }

    .hero-poster-box {
        width: 220px;
        height: 320px;
    }

    /* Smaller poster */
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .hero-desc {
        font-size: 1rem;
        -webkit-line-clamp: 3;
    }

    .hero-content {
        gap: 30px;
        padding: 0 30px;
    }
}

/* TABLETS (768px - 1024px) */
@media (max-width: 1024px) {
    .hero-container {
        height: 380px;
    }

    .hero-poster-box {
        display: none;
    }

    /* Hide poster to save space */
    .hero-overlay-gradient {
        background: linear-gradient(0deg, #09090b 0%, rgba(9, 9, 11, 0.6) 60%, transparent 100%);
    }

    .hero-content {
        justify-content: flex-start;
        align-items: flex-end;
        padding-bottom: 50px;
    }

    .hero-info-box {
        flex: none;
        width: 100%;
        text-align: left;
    }
}

/* PHONES (Max 600px) */
@media (max-width: 600px) {
    .content-wrapper {
        padding: 12px;
    }

    .hero-container {
        height: 420px;
        border-radius: 16px;
        margin-bottom: 25px;
    }

    .hero-nav {
        display: none;
    }

    .hero-dots {
        right: 50%;
        transform: translateX(50%);
        bottom: 20px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-desc {
        -webkit-line-clamp: 3;
        display: block;
    }

    .btn-watch {
        width: 100%;
        justify-content: center;
    }

    /* Grid 2 columns */
    .anime-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .play-button {
        display: none;
    }

    .card-overlay {
        display: none;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .history-card {
        flex: 0 0 140px;
    }
}
