/* movies.css - стили для страницы фильмов */

/* Сетка фильмов */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin: 25px 0;
}

/* Карточка фильма */
.movie-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    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;
}

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

/* Постер */
.movie-poster {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #e1e8ed;
}

/* Информация о фильме */
.movie-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

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

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

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

/* Бейдж комментариев */
.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);
}

/* Секция рейтинга */
.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;
}

/* Кнопка загрузки */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.load-more-btn {
    background: linear-gradient(90deg, #e94560, #3498db);
    border: none;
    border-radius: 30px;
    padding: 12px 40px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(90deg, #95a5a6, #bdc3c7);
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-btn i {
    font-size: 0.9rem;
}

/* Пустое состояние */
.no-movies {
    grid-column: 1/-1;
    text-align: center;
    padding: 50px;
}

.no-movies i {
    font-size: 3rem;
    color: #e1e8ed;
    margin-bottom: 15px;
}

.no-movies p {
    color: #95a5a6;
    font-size: 1rem;
}

/* Переключатель стран */
.country-tabs-container {
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
}

.country-tabs {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.country-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.country-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.country-tab.active {
    background: white;
    color: #764ba2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.country-tab .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85em;
}

.country-tab.active .count {
    background: #764ba2;
    color: white;
}

/* Бейдж страны на карточке фильма */
.country-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.country-badge.country-russian {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.country-badge.country-foreign {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Статистика */
.stats-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.stats-header h2 {
    font-size: 1.2em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #333;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.stat-percent {
    margin-top: 5px;
    font-size: 0.9em;
    color: #4a5568;
    font-weight: 600;
}

/* Фильтр по жанрам */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-header h2 {
    font-size: 1.2em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.genre-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.genre-btn {
    padding: 8px 16px;
    background: #f7f7f7;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.genre-btn:hover {
    background: #e0e0e0;
}

.genre-btn.active {
    background: #667eea;
    color: white;
}

/* Карточка фильма с индикатором страны */
.movie-card.russian {
    border-top: 3px solid #f093fb;
}

.movie-card.foreign {
    border-top: 3px solid #4facfe;
}

/* УДАЛИТЬ старые медиа-запросы в конце файла (после @media (max-width: 768px)) */
/* и ЗАМЕНИТЬ на эти: */

/* Адаптивность для сетки фильмов */
@media (max-width: 1200px) {
    .movies-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .movies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .movie-description {
        display: none; /* Скрываем описание на планшетах */
    }
    
    .movie-poster {
        height: 200px; /* Уменьшаем постер */
    }
}

@media (max-width: 480px) {
    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .movie-info {
        padding: 8px;
    }
    
    .movie-title {
        font-size: 0.9rem;
    }
    
    .movie-meta {
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .movies-grid {
        grid-template-columns: 1fr; /* Одна колонка на очень маленьких */
    }
    
    .movie-card {
        flex-direction: row; /* Горизонтальная карточка */
    }
    
    .movie-poster {
        width: 100px;
        height: 150px;
        border-bottom: none;
        border-right: 1px solid #e1e8ed;
    }
    
    .movie-description {
        display: -webkit-box; /* Показываем описание снова */
        -webkit-line-clamp: 2;
        font-size: 0.7rem;
    }
}