/* base.css - базовые сбросы и общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    min-height: 100vh;
}

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

/* Утилиты */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Стили для каруселей */
.carousel-section {
    width: 100%;
    padding: 40px 0;
    background: #ffffff;
    border-top: 1px solid #e1e8ed;
    border-bottom: 1px solid #e1e8ed;
    margin: 30px 0;
    overflow: hidden;
}

.carousel-section.series {
    background: #f8fafc;
}

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

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.carousel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e94560;
    display: flex;
    align-items: center;
    gap: 8px;
}

.carousel-title.series {
    color: #8b5cf6;
}

.carousel-title i {
    font-size: 1.3rem;
}

.carousel-subtitle {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Ссылка "Все" */
.all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #f8f9fa;
    color: #e94560;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #e1e8ed;
    transition: all 0.2s;
}

.all-link.series {
    color: #8b5cf6;
}

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

.all-link.series:hover {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

.all-link i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.all-link:hover i {
    transform: translateX(3px);
}

/* Обертка карусели */
.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    );
}

/* Бесконечная лента - 8 элементов */
.carousel-track {
    display: flex;
    gap: 20px;
    width: fit-content;
    animation: scroll 80s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

/* Карточка для карусели */
.carousel-card {
    flex: 0 0 180px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e1e8ed;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.carousel-card:hover {
    transform: translateY(-3px);
    border-color: #e94560;
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.15);
}

.carousel-card.series:hover {
    border-color: #8b5cf6;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.carousel-poster {
    width: 180px;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid #e1e8ed;
}

.carousel-info {
    padding: 10px;
}

.carousel-title-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-meta {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.carousel-meta i {
    color: #e94560;
    font-size: 0.7rem;
}

.carousel-meta.series i {
    color: #8b5cf6;
}

/* Секция с подборками */
.genre-section {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

.genre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.genre-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Сетка 6 элементов в ряду */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

/* Карточка для сетки */
.grid-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid #e1e8ed;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.grid-card:hover {
    transform: translateY(-3px);
    border-color: #e94560;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.1);
}

.grid-card.series:hover {
    border-color: #8b5cf6;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.1);
}

.grid-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-bottom: 1px solid #e1e8ed;
}

.grid-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.grid-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #95a5a6;
    margin-bottom: 6px;
}

.grid-genre {
    font-size: 0.7rem;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    color: #7f8c8d;
}

.series-details {
    display: flex;
    gap: 12px;
    font-size: 0.7rem;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.series-detail i {
    color: #8b5cf6;
    margin-right: 3px;
}

.grid-description {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin: 6px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rating-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rating-value {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f1c40f;
    display: flex;
    align-items: center;
    gap: 3px;
}

.interest-percentage {
    font-size: 0.7rem;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}

.comments-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-180px * 8 - 20px * 7)); }
}

@media (max-width: 1400px) {
    .genre-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1200px) {
    .genre-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .carousel-card { flex: 0 0 140px; }
    .carousel-poster { width: 140px; height: 200px; }
    .genre-grid { grid-template-columns: repeat(3, 1fr); }
    @keyframes scroll {
        100% { transform: translateX(calc(-140px * 8 - 20px * 7)); }
    }
}

@media (max-width: 480px) {
    .carousel-card { flex: 0 0 120px; }
    .carousel-poster { width: 120px; height: 170px; }
    .genre-grid { grid-template-columns: repeat(2, 1fr); }
}

.empty-block {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #95a5a6;
}