.video-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.35);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

.content-container {
    position: relative;
    z-index: 10;
    max-width: 1600px;
    margin: -350px auto 0 auto;
    padding: 0 3rem 4rem 3rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.poster-card {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.info-grid {
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-item h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-item span {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.character-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}
.char-dot {
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
}

.main-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.anime-header {
    margin-bottom: 2rem;
}

.anime-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    margin: 0 0 1.5rem 0;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
}
.pill.score {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

.action-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-watch {
    padding: 1rem 3rem;
    background: var(--color-text-primary);
    color: var(--color-bg-base);
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.btn-watch:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.description-box {
    margin-top: 3rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #e4e4e7;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.episodes-section {
    margin-top: 4rem;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.section-title::before {
    content: "";
    width: 4px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 2px;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.episode-btn {
    background: var(--color-bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.episode-btn:hover {
    background: var(--color-bg-elevated-hover);
    color: white;
    transform: translateY(-3px);
    border-color: var(--color-primary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .content-container {
        grid-template-columns: 1fr;
        margin-top: -100px;
        padding: 0 1.5rem 4rem 1.5rem;
    }
    .poster-card {
        width: 220px;
        margin: 0 auto;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    .main-content {
        text-align: center;
        align-items: center;
    }
    .anime-title {
        font-size: 2.5rem;
    }
    .meta-row {
        justify-content: center;
    }
    .sidebar {
        display: none;
    }
}

.read-more-btn {
    background: none;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.read-more-btn:hover {
    text-decoration: underline;
}

.episodes-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.episodes-header-row h2 {
    margin: 0;
    font-size: 1.8rem;
    border-left: 4px solid #8b5cf6;
    padding-left: 1rem;
}
.episode-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.episode-search-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    padding: 0.6rem 1rem;
    color: white;
    width: 140px;
    text-align: center;
    font-family: inherit;
    transition: 0.2s;
    -moz-appearance: textfield;
}
.episode-search-input:focus {
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.episode-search-input::-webkit-outer-spin-button,
.episode-search-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}
.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: #8b5cf6;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-info {
    color: #a1a1aa;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .content-container,
    .section,
    .container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .content-container {
        display: flex;
        flex-direction: column;
        margin-top: -50px;
        padding: 1rem 1.25rem 4rem 1.25rem;
        gap: 2rem;
    }

    .sidebar {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        width: 100%;
        order: 1;
    }

    .poster-card {
        width: 180px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        margin-bottom: 1rem;
    }

    .info-grid {
        width: 100%;
        padding: 1rem;
    }

    .main-content {
        order: 2;
        text-align: center;
        align-items: center;
    }

    .anime-title {
        font-size: 2.2rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .meta-row {
        justify-content: center;
        gap: 0.5rem;
    }

    .pill {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .action-row {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .btn-watch,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }

    .description-box {
        margin-top: 2rem;
        padding: 1.25rem;
        font-size: 1rem;
        text-align: left;
    }

    .episodes-section {
        margin-top: 3rem;
        order: 3;
    }

    .episodes-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .episode-search-wrapper {
        width: 100%;
    }

    .episode-search-input {
        width: 100%;
        text-align: left;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.75rem;
    }

    .episode-btn {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }

    .pagination-controls {
        flex-wrap: wrap;
    }
}
