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

@font-face {
    font-family: "Manrope";
    src: url("/assets/Manrope/Manrope-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Manrope";
    src: url("/assets/Manrope/Manrope-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Manrope";
    src: url("/assets/Manrope/Manrope-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Manrope";
    src: url("/assets/Manrope/Manrope-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Manrope",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */

.header {
    background: linear-gradient(135deg, #1a1c22 0%, #15171a 100%);
    border-bottom: 2px solid #e94560;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.nav-link.active {
    background: #e94560;
    color: #fff;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #e94560;
    text-decoration: none;
    white-space: nowrap;
}

.logo a {
    color: #e94560;
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 2;
    min-width: 300px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #e94560;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.2);
}

.search-btn {
    padding: 10px 20px;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #d63a52;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

/* ===== ADVANCED SEARCH ===== */

.advanced-search-wrapper {
    margin-bottom: 30px;
}

.advanced-search-toggle {
    background: none;
    border: none;
    color: #e94560;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.advanced-search-toggle:hover {
    color: #d63a52;
}

.toggle-icon {
    font-size: 10px;
}

.advanced-search-form {
    display: none;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.advanced-search-form.expanded {
    display: block;
}

.search-main-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.search-field-main {
    flex: 1;
}

.search-field-main .search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
}

.search-clear-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #e94560;
}

.filter-group input::placeholder {
    color: #666;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #e94560;
}

.filter-select option {
    background: #1a1c22;
    color: #e0e0e0;
}

.filter-select-multiple {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 100px;
}

.filter-select-multiple:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #e94560;
}

.filter-select-multiple option {
    background: #1a1c22;
    color: #e0e0e0;
    padding: 4px;
}

.filter-select-multiple option:checked {
    background: #e94560;
    color: #fff;
}

.filter-group-tags {
    grid-column: span 2;
}

.filter-hint {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    display: block;
}

/* Dropdown с поиском */
.filter-group-dropdown,
.filter-group-tags-dropdown,
.filter-group-tags-dropdown.filter-group-dropdown {
    position: relative;
}

.dropdown-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.dropdown-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #e94560;
}

.dropdown-clear {
    position: absolute;
    right: 5px;
    top: 42px;
    transform: translateY(-50%);
    background: rgb(233 69 96 / 77%);
    border: none;
    color: #ffe4e4;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.dropdown-clear:hover {
    background: #e94560;
    color: #fff;
}

.filter-select-wrapper {
    position: relative;
}

.filter-select-wrapper .dropdown-clear {
    right: 30px;
}

.dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #1a1c22;
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 4px;
    z-index: 1000;
    margin-top: 4px;
}

.filter-group-dropdown.active .dropdown-list {
    display: block;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #e0e0e0;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(233, 69, 96, 0.3);
}

/* Теги */
.filter-group-tags-dropdown {
    grid-column: span 2;
}

.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 30px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e94560;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 2px;
}

.tag-remove:hover {
    color: #ff6b6b;
}

.dropdown-item.selected {
    background: rgba(233, 69, 96, 0.3);
    color: #e94560;
}

/* ===== MAIN ===== */

main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* ===== CATALOG ===== */

.catalog h2,
.search-results h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #e94560;
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(233, 69, 96, 0.1);
    color: #b0b0b0;
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    color: #e94560;
}

.filter-btn.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

/* ===== BANNERS SECTION ===== */

.banners-section {
    margin-bottom: 40px;
}

.banners-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.banners-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.banner-card {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
}

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

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

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
}

.banner-overlay h3 {
    font-size: 1.1rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel for mobile */
.banners-carousel {
    display: none;
    position: relative;
    overflow: hidden;
}

.banners-track {
    display: flex;
    transition: transform 0.4s ease;
}

.banners-carousel .banner-card {
    flex: 0 0 100%;
    max-width: 100%;
}

.banners-carousel .banner-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

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

.carousel-dot.active {
    background: #e94560;
}

/* Scroll to catalog section on pagination */
#anime-catalog {
    scroll-margin-top: 100px;
}

/* ===== ANIME GRID ===== */

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

.anime-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.anime-card.fade-in-active {
    opacity: 1;
}

.anime-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(233, 69, 96, 0.2);
}

.anime-card:hover img {
    opacity: 1;
    border: 1px solid rgba(233, 69, 96, 0.5);
}

.anime-card a {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
}

.anime-card img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

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

.anime-card img.loaded {
    opacity: 1;
}

.anime-card img.lazy-load {
    filter: blur(2px);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.anime-card img.loaded-pending {
    filter: blur(2px);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.anime-card img.loaded-success {
    filter: blur(0);
    transform: scale(1);
    border: 2px solid rgba(233, 69, 96, 0.3);
}

.anime-card img.loaded-error {
    filter: blur(0);
    transform: scale(1);
    border: 2px solid rgba(255, 107, 107, 0.3);
    opacity: 0.8;
}

.anime-card img.loaded-error:hover {
    opacity: 1;
    cursor: pointer;
}

.anime-card {
    position: relative;
}

.card-badges {
    position: absolute;
    z-index: 10;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    height: 280px;
}

.card-badge.episode {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(233, 69, 96, 0.9);
    color: #fff;
    position: absolute;
    top: 10px;
    right: 5px;
    z-index: 10;
    font-size: 12px;
}

.card-badge.category {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(30, 30, 46, 0.85);
    color: #e0e0e0;
    backdrop-filter: blur(4px);
}

.anime-card h2 {
    padding: 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #e0e0e0;
    min-height: 42px;
    margin: 0;
    font-weight: 600;
}

.anime-card .title-en {
    display: block;
    padding: 0 12px 12px;
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

.date {
    padding: 8px 12px;
    font-size: 12px;
    color: #b0b0b0;
    border-top: 1px solid rgba(233, 69, 96, 0.1);
}

/* ===== PAGINATION ===== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 16px;
    background: rgba(233, 69, 96, 0.1);
    color: #b0b0b0;
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

.pagination-btn.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
    font-weight: bold;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: #666;
}

.pagination-ellipsis {
    padding: 10px 5px;
    color: #b0b0b0;
    font-size: 14px;
}

.pagination-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.page-link,
.page-info {
    padding: 10px 16px;
    background: rgba(233, 69, 96, 0.1);
    color: #b0b0b0;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid rgba(233, 69, 96, 0.2);
    transition: all 0.3s;
}

.page-link:hover {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

.page-info {
    cursor: default;
}

/* ===== ANIME DETAIL ===== */

.anime-detail {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
}

/* News layout: картинка сверху, заголовок, описание */
.news-layout {
    text-align: center;
}

.news-layout .detail-header {
    display: block;
    text-align: center;
    margin-bottom: 30px;
}

.news-layout .detail-poster-wrapper {
    max-width: 400px;
    margin: 0 auto 20px;
}

.news-layout .detail-poster {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #1a1c22;
    border-radius: 8px;
}

.news-layout .detail-info {
    text-align: center;
    width: 100%;
}

.news-layout .anime-title {
    font-size: 2rem;
    margin-bottom: 15px;
}

.news-layout .anime-title-en {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 20px;
}

.news-layout .detail-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.news-layout .detail-info-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.news-layout .detail-description {
    text-align: left;
    max-width: 800px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(233, 69, 96, 0.2);
}

.news-layout .detail-description h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #e94560;
}

.news-layout .description-text {
    line-height: 1.8;
    color: #ccc;
}

.news-layout .detail-back {
    margin-top: 30px;
}

@media (max-width: 768px) {
    .news-layout .anime-title {
        font-size: 1.5rem;
    }

    .news-layout .detail-meta,
    .news-layout .detail-info-grid {
        justify-content: flex-start;
    }
}

.anime-detail.news-layout .detail-back {
    margin-top: 30px;
}

.detail-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-poster {
    object-fit: cover;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.detail-dubbers {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 8px;
}

.detail-dubbers strong {
    display: block;
    color: #e94560;
    margin-bottom: 8px;
    font-size: 14px;
}

.dubbers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dubber-tag {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.detail-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #e94560;
}

.original-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #b0b0b0;
    font-style: italic;
}

.detail-rating {
    display: flex;
    gap: 20px;
    font-size: 16px;
    margin-bottom: 12px;
    color: #b0b0b0;
}

.rating-stars {
    color: #ffc107;
}

.views-count {
    color: #808080;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 12px;
    color: #808080;
    margin-bottom: 4px;
}

.meta-value {
    font-weight: 600;
    color: #e0e0e0;
}

.detail-genres {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-genres strong {
    flex-basis: 100%;
    color: #e94560;
    margin-bottom: 10px;
}

.detail-info-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    align-items: flex-start;
}

.detail-info-grid .detail-genres {
    margin-top: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.detail-info-grid .detail-genres.full-width {
    grid-column: 1 / -1;
}

.detail-info-grid .detail-genres strong {
    flex-basis: 100%;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-row-2x1 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.detail-row-2x1 .detail-genres {
    margin-top: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.detail-row-2x1 .detail-genres strong {
    flex-basis: 100%;
    margin-bottom: 8px;
    font-size: 14px;
}

.genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.genre-tag {
    padding: 6px 12px;
    background: rgba(233, 69, 96, 0.1);
    color: #b0b0b0;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid rgba(233, 69, 96, 0.2);
    transition: all 0.3s;
    font-size: 14px;
}

.genre-tag:hover {
    background: #e94560;
    color: white;
}

.creation-info {
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(233, 69, 96, 0.1);
    border-bottom: 1px solid rgba(233, 69, 96, 0.1);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-block h3 {
    font-size: 16px;
    color: #e94560;
    margin-bottom: 8px;
}

.info-block p {
    color: #b0b0b0;
    line-height: 1.6;
}

.detail-description {
    margin-bottom: 30px;
}

.detail-description h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #e94560;
}

.description-text {
    color: #b0b0b0;
    line-height: 1.8;
    white-space: pre-line;
}

.trailer-section {
    margin-bottom: 30px;
}

.trailer-section h2 {
    font-size: 20px;
    color: #e94560;
    margin-bottom: 15px;
}

.trailer-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.trailer-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.voice-actors {
    margin-bottom: 30px;
}

.voice-actors h2 {
    font-size: 20px;
    color: #e94560;
    margin-bottom: 15px;
}

.voice-actors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.actor-item {
    padding: 12px;
    background: rgba(233, 69, 96, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.1);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.actor-name {
    color: #e0e0e0;
    font-weight: 500;
}

.actor-with-role {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.actor-role {
    color: #b0b0b0;
    font-size: 0.9em;
    font-style: italic;
}

.actor-character-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.character-image {
    width: 90px;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid #e94560;
}

.actor-character-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.episodes-section-full {
    margin-bottom: 30px;
}

.episodes-section-full h2 {
    font-size: 20px;
    color: #e94560;
    margin-bottom: 15px;
}

.episodes-controls {
    margin-bottom: 15px;
}

.episodes-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.episodes-btn {
    padding: 8px 16px;
    background: rgba(233, 69, 96, 0.1);
    color: #b0b0b0;
    border: 1px solid rgba(233, 69, 96, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.episodes-btn:hover,
.episodes-btn.active {
    background: #e94560;
    color: white;
    border-color: #e94560;
}

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

.episode-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    aspect-ratio: 16/9;
    transition: all 0.3s;
}

.episode-card:hover {
    transform: translateY(-2px);
}

.episode-card.active {
    background: rgba(233, 69, 96, 0.1);
}
.episode-card img {
    border: 3px solid rgba(233, 69, 96, 0.1);
}
.episode-card:hover img {
    border-color: #e94560;
}
.episode-card.active img {
    border-color: #e94560;
}
.episode-card img {
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}
.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -63px;
}

.episode-num {
    color: #fff2f5;
    font-weight: 600;
    padding: 5px 10px;
    background: #ea4460;
    border-radius: 0px 5px 5px 0px;
    backdrop-filter: blur(10px);
}

.episode-watch-btn {
    padding: 6px 12px;
    background: #e94560;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.episode-watch-btn:hover {
    background: #d63a52;
}

.recommendations {
    margin-bottom: 30px;
}

.recommendations h2 {
    font-size: 20px;
    color: #e94560;
    margin-bottom: 15px;
}

.similar-anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.genre-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #e94560;
}

.results-count {
    color: #b0b0b0;
    margin-bottom: 20px;
}

.genre-back {
    padding-top: 30px;
    border-top: 1px solid rgba(233, 69, 96, 0.1);
}

.detail-back {
    padding-top: 30px;
    border-top: 1px solid rgba(233, 69, 96, 0.1);
}

.btn-back {
    display: inline-block;
    padding: 12px 24px;
    background: #e94560;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-back:hover {
    background: #d63a52;
    transform: translateX(-4px);
}

/* ===== SEARCH ===== */

.search-results {
    padding: 20px 0;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #808080;
}

.search-guide {
    text-align: center;
    padding: 60px 20px;
}

.search-guide h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

.search-guide p {
    font-size: 16px;
    color: #808080;
}

/* ===== FOOTER ===== */

.footer {
    background: #1a1c22;
    border-top: 2px solid #e94560;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    color: #808080;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .search-form {
        width: 100%;
        min-width: auto;
    }

    .banners-grid {
        display: none;
    }

    .banners-carousel {
        display: block;
    }

    .banner-overlay h3 {
        font-size: 0.95rem;
    }

    .detail-header {
        grid-template-columns: 1fr;
    }

    .detail-info h1 {
        font-size: 24px;
    }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .anime-card img {
        height: 220px;
    }
}

/* Tablet: 2 columns for banners */
@media (min-width: 502px) and (max-width: 768px) {
    .banners-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .banners-carousel {
        display: none;
    }
}

@media (max-width: 501px) {
    .logo {
        font-size: 20px;
    }

    .header .container {
        padding: 0 10px;
    }

    .search-form {
        flex-direction: column;
    }

    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-info h1 {
        font-size: 20px;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .page-link {
        width: 100%;
        text-align: center;
    }
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 2fr)) !important;
    }
}

/* ===== LOADING ===== */

.loading {
    opacity: 0.5;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #e94560;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== PROGRESS INDICATOR ===== */

.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e94560, #e8847a);
    transition: width 0.3s ease;
}

/* ===== LOADING INDICATOR ===== */

.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.loading-indicator.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.loading-indicator p {
    margin: 0;
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 500;
}

.end-of-results {
    display: none;
    text-align: center;
    padding: 40px 0;
    color: #888;
    font-size: 18px;
    animation: fadeIn 0.5s ease;
}

.error-message {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 8px;
    margin: 20px 0;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.error-message.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.error-message p {
    color: #e94560;
    font-weight: 500;
    margin: 0;
}

.btn-retry {
    background: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.2);
}

.btn-retry:hover {
    background: #d93a56;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .search-form {
        width: 100%;
        min-width: auto;
    }

    .detail-header {
        grid-template-columns: 1fr;
    }

    .detail-info h1 {
        font-size: 24px;
    }

    .anime-grid {
        grid-template-columns: repeat(
            auto-fill,
            minmax(140px, 1fr)
        ); /* Уменьшенный размер карточки */
        gap: 12px; /* Уменьшенный отступ */
    }

    .anime-card img {
        height: 196px; /* Пропорционально уменьшенный размер */
    }

    .anime-card h3 {
        font-size: 12px; /* Меньший шрифт для названия */
        min-height: 36px;
    }

    .date {
        font-size: 10px; /* Меньший шрифт для даты */
    }

    /* Дополнительные стили для бесконечной прокрутки на мобильных */
    .loading-indicator {
        padding: 15px;
    }

    .loading-indicator .spinner {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 510px) {
    .logo {
        font-size: 20px;
    }
    .header .container {
        padding: 0 10px;
    }

    .search-form {
        flex-direction: column;
    }

    .anime-grid {
        grid-template-columns: repeat(
            2,
            1fr
        ); /* Только 2 карточки в ряд на маленьких экранах */
    }

    .detail-info h1 {
        font-size: 20px;
    }

    .pagination {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Дополнительные стили для бесконечной прокрутки на маленьких мобильных */
    .loading-indicator p {
        font-size: 12px;
    }
}
.anime-title-en {
    opacity: 0.5;
    font-size: 1.2em;
}
.anime-title {
    margin-bottom: 0px !important;
    line-height: normal;
}
.mtags {
    position: relative;
    display: inline-block;
    text-transform: uppercase;
}

.taginfo {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 10px;
    min-width: 300px;
    z-index: 100;
    display: none;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    text-transform: capitalize;
}

.mtags:hover .taginfo {
    display: flex;
}

.mtrank {
    color: #4caf50;
    font-weight: bold;
    margin-bottom: 5px;
}

.mtinfo {
    font-size: 14px;
    color: #ccc;
    font-weight: 300;
}
.episode-preview {
    width: 99%;
    border-radius: 10px;
}

.video-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.video-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(233, 69, 96, 0.3);
    color: #ccc;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.video-tab:hover {
    border-color: #e94560;
    color: #fff;
}

.video-tab.active {
    background: rgba(233, 69, 96, 0.2);
    border-color: #e94560;
    color: #e94560;
}
#video-iframe {
    aspect-ratio: 16/9;
    border-radius: 20px;
}
.anime-alt-titles {
    display: flex;
    gap: 0px 10px;
    flex-wrap: wrap;
}
.anime-alt-titles b {
    background: #341c20;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 10px;
    color: #d4d4d4;
    font-weight: 300;
}
img.anime-poster {
    border-radius: 10px;
    position: relative;
}

.img-loading {
    position: relative;
    display: inline-block;
}

.img-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: poster-spin 0.8s linear infinite;
    z-index: 10;
    pointer-events: none;
}

@keyframes poster-spin {
    to {
        transform: rotate(360deg);
    }
}
.anilist-tags-list a {
    color: #b0b0b0;
    padding: 3px;
}

/* ===== ANIME TOOLTIP ===== */

.anime-tooltip {
    position: absolute;
    z-index: 10000;
    width: 320px;
    background: linear-gradient(145deg, #1a1c22 0%, #15171a 100%);
    border: 1px solid #e94560;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    pointer-events: auto;
    animation: tooltip-fadein 0.2s ease-out;
}

@keyframes tooltip-fadein {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #1a1c22 0%, #15171a 100%);
    border-right: 1px solid #e94560;
    border-bottom: 1px solid #e94560;
    z-index: 1;
}

.anime-tooltip-loading {
    padding: 40px;
    text-align: center;
    color: #888;
}

.anime-tooltip-content {
    padding: 0;
}

.at-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.at-body {
    padding: 12px;
}

.at-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.at-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.at-badge-type {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.at-badge-hd {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.at-badge-episodes {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.at-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
}

.at-info-item {
    display: flex;
    color: #b0b0b0;
}

.at-info-label {
    min-width: 70px;
    color: #888;
}

.at-info-value {
    color: #e0e0e0;
}

.at-description {
    font-size: 13px;
    color: #b0b0b0;
    line-height: 1.5;
    margin-bottom: 12px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.at-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.at-genre {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #b0b0b0;
    transition: all 0.2s ease;
}

.at-genre:hover {
    background: rgba(233, 69, 96, 0.2);
    border-color: rgba(233, 69, 96, 0.5);
    color: #e94560;
}

.at-voice-actors {
    margin-bottom: 12px;
}

.at-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
}

.at-actors {
    font-size: 12px;
    color: #b0b0b0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.at-actor {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 3px;
}

.at-actions {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.at-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.at-btn-play {
    background: linear-gradient(135deg, #e94560 0%, #c44a3d 100%);
    color: #fff;
}

.at-btn-play:hover {
    background: linear-gradient(135deg, #ff7a6b 0%, #e94560 100%);
    transform: translateY(-1px);
}

.at-btn-add {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.at-btn-add:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Tooltip positioning */
.anime-tooltip.tooltip-top::before {
    top: auto;
    bottom: -8px;
    border-bottom: 1px solid #e94560;
    border-right: 1px solid #e94560;
    border-top: none;
    border-left: none;
}

.anime-tooltip.tooltip-bottom::before {
    top: -8px;
    border-top: 1px solid #e94560;
    border-left: 1px solid #e94560;
}

.anime-card[data-tooltip-loaded="false"] {
    position: relative;
}
