/* ============================================
   PlayWatch — стильный каталог игр
   Тёмная тема + градиенты + glassmorphism
   ============================================ */

/* --- Глобальные переменные --- */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16162a;
    --bg-glass: rgba(26, 26, 46, 0.7);
    --accent-1: #667eea;
    --accent-2: #764ba2;
    --accent-3: #f093fb;
    --accent-glow: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --border: rgba(139, 92, 246, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* --- Сброс и базовые стили --- */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(102, 126, 234, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(118, 75, 162, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* --- Навбар (стеклянный) --- */
.navbar {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    padding: 0.5rem 0.8rem !important;
}

.nav-link:hover {
    color: var(--text-primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.navbar-text {
    color: var(--text-primary) !important;
    font-weight: 600;
}

/* --- Заголовки --- */
h1, h2, h3, h4, h5 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.3px;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #b8b8d0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Форма фильтров --- */
form.row {
    background: var(--bg-card);
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem !important;
}

/* --- Поля ввода --- */
.form-control, .form-select {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    transition: all 0.2s;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-secondary) !important;
    border-color: var(--accent-1) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
    color: var(--text-primary) !important;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-text {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
}

/* --- Кнопки --- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.6rem 1.4rem;
    transition: all 0.25s;
    border: none;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 16px rgba(56, 239, 125, 0.25);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38ef7d 0%, #11998e 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56, 239, 125, 0.4);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.5);
    color: #1a1a2e;
}

.btn-outline-warning {
    background: transparent;
    border: 2px solid var(--warning);
    color: var(--warning);
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: #1a1a2e;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent-1);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
}

/* --- Карточки игр --- */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    opacity: 0;
    transition: opacity 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.2),
        0 0 60px rgba(139, 92, 246, 0.15);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s;
}

.game-card:hover .card-img-top {
    transform: scale(1.08);
}

.game-card .placeholder-img {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.game-card .placeholder-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.1));
}

.game-card .card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-card .card-title {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.game-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.badge-genre, .badge-platform, .badge-year {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-genre {
    background: rgba(102, 126, 234, 0.15);
    color: #93a5f0;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.badge-platform {
    background: rgba(118, 75, 162, 0.15);
    color: #b891e0;
    border: 1px solid rgba(118, 75, 162, 0.3);
}

.badge-year {
    background: rgba(160, 160, 184, 0.1);
    color: var(--text-muted);
}

/* --- Бейдж рейтинга --- */
.badge-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a1a2e;
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-rating.no-rating {
    background: rgba(160, 160, 184, 0.15);
    color: var(--text-muted);
    box-shadow: none;
}

/* --- Карточка фильтров и сортировки --- */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Страница игры --- */
.game-hero {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-cover {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: var(--text-muted);
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.game-info-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.game-description {
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
    font-size: 1rem;
}

/* --- Отзывы --- */
.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.review-card:hover {
    border-left-color: var(--accent-glow);
    transform: translateX(4px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.review-author {
    font-weight: 700;
    color: var(--text-primary);
}

.review-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.review-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* --- Форма отзыва --- */
.review-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* --- Таблицы (админка) --- */
.table {
    color: var(--text-primary);
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table thead {
    background: var(--bg-secondary);
}

.table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.table img {
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* --- Карточка (общая) --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* --- Alerts --- */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.2rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left: 4px solid var(--danger);
}

/* --- Пагинация и пустые состояния --- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* --- Футер --- */
footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* --- Скроллбар --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-2);
}

/* --- Адаптив --- */
@media (max-width: 992px) {
    .game-hero {
        grid-template-columns: 1fr;
    }

    .game-cover {
        aspect-ratio: 16/9;
        max-height: 300px;
    }

    .game-info h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.6rem;
    }

    .game-card .card-img-top,
    .game-card .placeholder-img {
        height: 150px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}