/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #0b141d;  /* Тёмный фон */
    color: white;
    line-height: 1.6;
}

/* Заголовок и логотип */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: #0b141d;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
}

header .logo a {
    text-decoration: none;
    color: white;
    font-size: 35px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

header .logo img {
    margin-right: 15px;
}

header .search-bar input {
    padding: 12px;
    width: 300px;
    border-radius: 25px;
    border: 1px solid #4A6A8B;
    background-color: #0b141d;
    color: white;
    font-size: 16px;
    transition: 0.3s;
}

header .search-bar input::placeholder {
    color: #A0A0A0;
}

header .search-bar input:focus {
    border: 1px solid #FFD700;
    outline: none;
}

/* Баннер */
.banner {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 20px;
    margin-top: 30px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
}

.banner-slider {
    display: flex;
    width: 100%;
    animation: slide 12s infinite;
}

.banner-item {
    width: 100%;
    height: 100%;
}

.banner-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
}

/* Анимация слайдера */
@keyframes slide {
    0% { transform: translateX(0); }
    33% { transform: translateX(-100%); }
    66% { transform: translateX(-200%); }
    100% { transform: translateX(0); }
}

/* Стили для списка фильмов */
.movie-list {
    display: flex;
    flex-wrap: nowrap; /* Все карточки в одном ряду */
    overflow-x: auto;
    padding: 20px;
    gap: 20px;
    margin-top: 30px;
    scroll-snap-type: x mandatory; /* Чтобы плавно прокручивался слайдер */
    justify-content: center; /* Центрируем карточки */
}

/* Стили для карточки фильма */
.movie-card {
    background-color: #0b141d;
    width: 250px;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    scroll-snap-align: center; /* Выравнивание карточек */
    display: flex;
    flex-direction: column;
    height: 450px; /* Высота карточки */
    margin: 0 10px; /* Добавляем отступы между карточками */
}

.movie-card:hover {
    transform: scale(1.05);
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.5);
}

/* Адаптивность */
@media (max-width: 768px) {
    .movie-list {
        flex-direction: row;
        gap: 10px;
        justify-content: center; /* Центрируем карточки */
        padding: 0 20px; /* Отступы по бокам */
    }

    .movie-card {
        width: 180px;
        flex-shrink: 0;
        height: 400px; /* Мобильная высота */
    }

    .movie-card-img {
        height: 150px; /* Меньше изображение на мобильных */
    }
}
.movie-card-img {
    position: relative;
    overflow: hidden;
    height: 200px; /* Высота изображения */
}

.movie-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-card-info {
    padding: 20px;
    background-color: #0b141d;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.movie-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
    word-wrap: break-word; /* Чтобы длинные названия красиво переносились */
    white-space: normal; /* Убираем обрезку названия */
}

.movie-genre {
    font-size: 14px;
    color: #A0A0A0;
}

.movie-rating {
    font-size: 16px;
    color: #FFD700;
    margin-top: 10px;
}

/* Удаляем подчеркивание с ссылок */
a {
    text-decoration: none;
}

/* Стили для звездочек */
.movie-rating::before {
    content: "⭐";
    padding-right: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    header .logo, header .search-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    header .search-bar input {
        width: 250px;
    }

    .movie-list {
        flex-direction: row;
        gap: 10px;
        justify-content: flex-start;
    }

    .movie-card {
        width: 180px;
        flex-shrink: 0;
        height: 400px; /* Мобильная высота */
    }

    .movie-card-img {
        height: 150px; /* Меньше изображение на мобильных */
    }

    .banner-item img {
        height: 250px;
    }

    /* Чтобы не обрезалось при скролле */
    .banner {
        height: 250px;
    }
}
