/* wwwroot/css/index.css */

/* Общие настройки */
:root {
    --primary-color: #00bfff;
    --primary-hover: #0095cc;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #1f1f1f;
    --text-muted: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
}

h1 {
    text-align: center;
    font-size: 2em;
    margin: 40px 0 30px;
    font-weight: 700;
    color: #333;
}

h2 {
    font-size: 1.5em;
    margin-bottom: 25px;
    font-weight: 600;
    color: #222;
}

/* --- Основная сетка (Левая колонка + Правая колонка) --- */
.main-content {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

/* --- Левая колонка: Популярные игры --- */
.popular-games {
    flex: 1;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .game-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

    .game-card img {
        width: 100%;
        height: 180px; /* Фиксированная высота постера */
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .game-card h3 {
        margin: 0 0 8px;
        font-size: 1rem;
        font-weight: 600;
    }

        .game-card h3 a {
            color: var(--text-color);
            text-decoration: none;
            transition: color 0.2s;
        }

            .game-card h3 a:hover {
                color: var(--primary-color);
            }

    .game-card .rating {
        color: #ffb400;
        font-size: 0.9rem;
    }

    .game-card .star {
        color: #e0e0e0;
    }

        .game-card .star.filled {
            color: #ffb400;
        }

/* --- Правая колонка: Новости --- */
.latest-news {
    flex: 1;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.news-item {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

    .news-item:hover {
        transform: translateX(5px);
    }

    .news-item .news-title {
        display: block;
        color: var(--primary-color);
        font-weight: 600;
        text-decoration: none;
        margin-bottom: 6px;
        font-size: 1rem;
    }

        .news-item .news-title:hover {
            color: var(--primary-hover);
            text-decoration: underline;
        }

    .news-item .news-excerpt {
        color: var(--text-muted);
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0;
    }

/* --- Кнопки --- */
.btn-catalog, .btn-news {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
    text-align: center;
}

    .btn-catalog:hover, .btn-news:hover {
        background-color: var(--primary-hover);
    }

/* --- Секция: Скоро выйдут (Слайдер) --- */
.coming-soon {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

    .coming-soon h2 {
        text-align: center;
    }

.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.carousel-container {
    flex: 1;
    overflow: hidden; /* Скрывает выходящие за границы карточки */
    padding: 10px 0; /* Отступы сверху/снизу для тени */
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    flex: 0 0 250px;
    margin-right: 20px; 
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

    .carousel-item:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-hover);
    }

    .carousel-item img {
        width: 100%;
        height: 340px;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .carousel-item .game-title {
        display: block;
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-decoration: none;
    }

    .carousel-item .release-date {
        display: block;
        color: var(--text-muted);
        font-size: 0.9rem;
    }

/* Кнопки навигации слайдера */
.carousel-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
    z-index: 2;
}

    .carousel-btn:hover {
        background-color: var(--primary-hover);
    }

/* --- Адаптивность для мобильных --- */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .games-grid {
        grid-template-columns: repeat(3, 1fr); /* На планшетах 3 */
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки */
    }

    .carousel-item {
        flex: 0 0 200px;
        margin-right: 15px;
    }

        .carousel-item img {
            height: 280px;
        }
}

@media (max-width: 576px) {
    .games-grid {
        grid-template-columns: 1fr; /* 1 колонка */
    }

    .carousel-wrapper {
        flex-direction: column;
    }

    .carousel-container {
        width: 100%;
    }

    .carousel-btn {
        width: 100%;
        height: 45px;
        border-radius: 8px;
    }
}

/* === Рейтинг на странице игры === */
.game-rating-display {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0,191,255,0.1), rgba(0,191,255,0.05));
    border: 1px solid rgba(0,191,255,0.2);
    border-radius: 8px;
    margin: 10px 0;
}

    .game-rating-display .rating-number {
        font-size: 1.8em;
        font-weight: 700;
        color: #00bfff;
        line-height: 1;
    }

    .game-rating-display .rating-divider {
        color: #888;
        font-weight: 500;
        font-size: 1.2em;
    }

    .game-rating-display .rating-total {
        color: #666;
        font-weight: 600;
        font-size: 1.1em;
    }

    .game-rating-display .rating-label {
        color: #888;
        font-size: 0.9em;
        margin-left: 6px;
    }

/* Адаптив для мобильных */
@media (max-width: 600px) {
    .game-rating-display {
        padding: 6px 12px;
    }

        .game-rating-display .rating-number {
            font-size: 1.5em;
        }
}