/* Games Page Styles */

/* Page Content */
.games-page-content {
    min-height: 100vh;
    padding: 100px 60px 60px;
    background: var(--color-bg, #0a0a0a);
}

/* Base launcher mode padding - overridden in scaling section below */

/* Page Title Section */
.page-title-section {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 36px;
    font-weight: 800;
    color: #f0f0f0;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-subtitle {
    font-size: 16px;
    color: #888;
    margin: 0;
}

/* Games Grid - CSS Grid Layout with consistent sizing */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Game Card Base - Force consistent sizing */
.games-grid .game-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 100%;
    min-width: 0;
    /* Prevent grid blowout */
    max-width: 100%;
    position: relative;
}

.games-grid .game-card:hover {
    transform: translateY(-8px);
}

/* Image Container - Single consistent ratio */
.games-grid .game-card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
}

.games-grid .game-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.games-grid .game-card:hover .game-card-image {
    transform: scale(1.05);
}

.games-grid .game-card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    border-radius: 8px;
    filter: blur(20px);
    transform: scale(1.1) translateY(10px);
    transition: opacity 0.3s ease;
}

.games-grid .game-card:hover .game-card-glow {
    opacity: 0.5;
}

.games-grid .game-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.games-grid .game-card-info {
    padding: 10px 0 0;
}

.games-grid .game-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating Display */
.game-card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.card-stars {
    display: flex;
    gap: 1px;
}

.card-star {
    font-size: 12px;
}

.card-star.filled {
    color: #d0d0d0;
}

.card-star.empty {
    color: #4a4a4a;
}

.card-reviews {
    font-size: 11px;
    color: #8f98a0;
}

/* Launcher mode - smaller rating */
body.launcher-mode .game-card-rating {
    margin-top: 2px;
}

body.launcher-mode .card-star {
    font-size: 10px;
}

body.launcher-mode .card-reviews {
    font-size: 9px;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: #888;
    grid-column: 1 / -1;
}

.loading-indicator.visible {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #DC2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive grid */
@media (max-width: 1400px) {
    .games-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Active nav link */
.nav-link.active {
    color: #ffffff !important;
}

/* Launcher mode adjustments */
body.launcher-mode .page-title-section {
    margin-bottom: 12px;
    padding: 0 10px;
}

body.launcher-mode .page-title {
    font-size: 20px;
}

body.launcher-mode .page-subtitle {
    display: none;
}

body.launcher-mode .games-grid .game-card-image-container {
    border-radius: 4px;
}

body.launcher-mode .games-grid .game-card-glow {
    border-radius: 4px;
}

/* ========== LAUNCHER MODE SCALING ========== */
/* Scale down content aggressively for launcher window */

body.launcher-mode .games-page-content {
    padding: 5px 10px 20px;
    min-height: auto;
}

/* More columns for launcher - compact cards */
body.launcher-mode .games-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px !important;
    max-width: none !important;
}

/* Smaller card title in launcher */
body.launcher-mode .games-grid .game-card-title {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #f0f0f0;
}

body.launcher-mode .games-grid .game-card-info {
    padding: 6px 0 0;
}

/* Smaller badge in launcher */
body.launcher-mode .games-grid .game-card-badge {
    font-size: 8px;
    padding: 3px 6px;
    top: 6px;
    left: 6px;
    border-radius: 3px;
}

/* Reduce hover effect in launcher */
body.launcher-mode .games-grid .game-card:hover {
    transform: translateY(-4px);
}

body.launcher-mode .games-grid .game-card:hover .game-card-image {
    transform: scale(1.03);
}

/* Hide footer in launcher */
body.launcher-mode .footer {
    display: none;
}

/* Hide header in launcher (handled by C# header) */
body.launcher-mode .main-header {
    display: none;
}

/* Rating display in launcher - larger for readability */
body.launcher-mode .game-card-rating {
    margin-top: 4px;
}

body.launcher-mode .card-star {
    font-size: 12px;
}

body.launcher-mode .card-reviews {
    font-size: 10px;
    color: #a0a0a0;
    font-weight: 500;
}

/* Hide loading indicator footer styling in launcher */
body.launcher-mode .loading-indicator {
    padding: 20px;
    gap: 10px;
}

body.launcher-mode .loading-spinner {
    width: 30px;
    height: 30px;
}

/* Responsive grid in launcher mode */
/* Scale UP for larger screens */
@media (min-width: 1400px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1600px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1800px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 2000px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    }
}

/* Scale DOWN for smaller screens */
@media (max-width: 1200px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    body.launcher-mode .games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Footer visible by default on this page */
.footer.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ========== Search Overlay ========== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 80px 24px 24px;
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px 20px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: rgba(220, 38, 38, 0.6);
    background: rgba(255, 255, 255, 0.12);
}

.search-input-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 18px;
    color: #f0f0f0;
    margin-left: 16px;
    font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.search-close-btn svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.search-results {
    margin-top: 24px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.search-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    padding: 40px;
    font-size: 16px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.search-result-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.search-result-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

.search-result-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #1a1a1a;
}

.search-result-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 60px 20px;
}

.search-no-results svg {
    width: 64px;
    height: 64px;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

.search-no-results p {
    font-size: 16px;
    margin: 0;
}

/* Custom scrollbar for search results */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== Game Hover Popup ========== */
.hover-popup {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s cubic-bezier(0.33, 1, 0.68, 1),
        visibility 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}

.hover-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.hover-popup-inner {
    width: 500px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}

.hover-popup.visible .hover-popup-inner {
    transform: scale(1);
}

/* Header Image */
.hover-popup-image-container {
    position: relative;
    width: 100%;
    height: 275px;
    background: #1a1a1a;
    overflow: hidden;
}

.hover-popup-header,
.hover-popup-screenshot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hover-popup-screenshot {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.hover-popup-screenshot.active {
    opacity: 1;
}

/* NSFW content blur for games banned in Germany */
.hover-popup-screenshot.nsfw-blur {
    filter: blur(20px);
    transform: scale(1.1);
    /* Prevent blur edges from showing */
}

.hover-popup-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #141414);
}

/* Screenshot Indicators */
.hover-popup-indicators {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-popup.has-screenshots .hover-popup-indicators {
    opacity: 1;
}

.hover-popup-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s ease;
}

.hover-popup-indicator.active {
    background: #ffffff;
}

/* Content Section */
.hover-popup-content {
    padding: 12px 12px 15px;
}

.hover-popup-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Genre Tags */
.hover-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.hover-popup-tag {
    padding: 3px 6px;
    background: #2a2a2a;
    border-radius: 2px;
    font-size: 11px;
    color: #8f98a0;
}

/* Stars Rating */
.hover-popup-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.hover-popup-star {
    font-size: 14px;
}

.hover-popup-star.filled {
    color: #ffd700;
}

.hover-popup-star.empty {
    color: #4a4a4a;
}

/* Steam Review Score Display - No Background */
.review-score {
    font-size: 13px;
    font-weight: 600;
    color: #66c0f4;
}

.review-score.overwhelmingly-positive {
    color: #66c0f4;
}

.review-score.very-positive {
    color: #66c0f4;
}

.review-score.positive {
    color: #66c0f4;
}

.review-score.mostly-positive {
    color: #a2d76d;
}

.review-score.mixed {
    color: #b9a479;
}

.review-score.negative {
    color: #a24e44;
}

.review-score.neutral {
    color: #999;
}

.review-count {
    font-size: 12px;
    color: #8f98a0;
    margin-left: 6px;
}

/* Release Date */
.hover-popup-release {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #8f98a0;
}

.hover-popup-release svg {
    width: 14px;
    height: 14px;
}

/* Positioning classes */
.hover-popup.position-right {
    transform-origin: left center;
}

.hover-popup.position-left {
    transform-origin: right center;
}

/* ========== Launcher Mode - Smaller Popup ========== */
body.launcher-mode .hover-popup-inner {
    width: 420px;
}

body.launcher-mode .hover-popup-image-container {
    height: 230px;
}

body.launcher-mode .hover-popup-content {
    padding: 10px 10px 12px;
}

body.launcher-mode .hover-popup-title {
    font-size: 13px;
    margin-bottom: 6px;
}

body.launcher-mode .hover-popup-tags {
    margin-bottom: 8px;
}

body.launcher-mode .hover-popup-tag {
    padding: 2px 5px;
    font-size: 10px;
}

body.launcher-mode .hover-popup-star {
    font-size: 12px;
}

body.launcher-mode .hover-popup-release {
    font-size: 11px;
}

body.launcher-mode .hover-popup-release svg {
    width: 12px;
    height: 12px;
}

/* ========== Filter Bar - Steam Style ========== */
.filter-bar {
    display: none;
}

body.launcher-mode .filter-bar,
.filter-bar.has-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

/* Sticky filter bar when filters are active */
.filter-bar.has-filters {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0a0a;
    padding: 10px 0 12px;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
}

/* Filter Dropdown Container */
.filter-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Filter Label */
.filter-dropdown::before {
    content: attr(data-label);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 400;
}

/* Filter Button - Text Only */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.15s ease;
}

.filter-btn:hover {
    color: #fff;
}

.filter-btn.active {
    color: #fff;
}

.filter-arrow {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.filter-dropdown.open .filter-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 150px;
    max-height: 280px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.12s ease;
}

.filter-dropdown.open .filter-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Scrollbar for dropdown */
.filter-dropdown-menu::-webkit-scrollbar {
    width: 5px;
}

.filter-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.filter-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* Filter Option */
.filter-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.1s ease;
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.filter-option.selected {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Active Filters - Hidden in Steam style, shown in button text instead */
.active-filters {
    display: none;
}

/* Clear All Button */
.filter-clear-btn {
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.15s ease;
    margin-left: 8px;
}

.filter-clear-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}