/* ============================================
   Games Listing Page Styles
   ============================================ */

.games-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Games Header */
.games-header {
    text-align: center;
    margin-bottom: 3rem;
}

.games-header-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    animation: iconFloat 3s ease-in-out infinite;
}

.games-header-icon svg {
    width: 32px;
    height: 32px;
    animation: iconPulse 2.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(5deg);
    }
}

.games-header-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.games-typewriter-text {
    font-size: 1.25rem;
    font-weight: 600;
    min-height: 1.75rem;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.games-typewriter-text::after {
    content: '|';
    animation: blink 1s infinite;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Search Bar and Sort */
.games-search-sort-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-gray);
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3.5rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9375rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-clear {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.search-clear:hover {
    background: rgba(226, 232, 240, 0.5);
    color: var(--text-dark);
}

/* Filter Tabs */
.games-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-tab:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--gradient-end) 100%);
    color: var(--bg-white);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

/* Sort Select (inside search-sort-bar) */
.games-search-sort-bar .sort-select {
    padding: 1rem 1.5rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    min-width: 180px;
    flex-shrink: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

[data-theme="dark"] .games-search-sort-bar .sort-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d1d5db' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.games-search-sort-bar .sort-select option[value="default"] {
    color: var(--text-light);
}

.games-search-sort-bar .sort-select option:not([value="default"]) {
    color: var(--text-dark);
}

.games-search-sort-bar .sort-select:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.games-search-sort-bar .sort-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Games Grid Wrapper */
.games-grid-wrapper {
    width: 100%;
    position: relative;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    row-gap: 2.5rem;
    width: 100%;
    padding-bottom: 3rem;
}

.game-card-item {
    width: 100%;
    display: block;
}

.game-card-item.hidden {
    display: none;
}

/* Pagination */
.games-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.75rem 1.25rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 44px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--gradient-end) 100%);
    color: var(--bg-white);
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Card Styles (Adapted from tra.css) */
.card-container {
    width: 220px;
}

.card-effect {
    perspective: 1000px;
}

.card-inner {
    --card-bg: #ffffff;
    --card-accent: #ff8a65;
    --card-text: #263238;
    --card-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-height: 290px;
    height: 320px;
    background: var(--card-bg);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition:
        transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1),
        background 0.3s ease;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, sans-serif;
    transform-style: preserve-3d;
}

[data-theme="dark"] .card-inner {
    --card-bg: #1f2937;
    --card-text: #f9fafb;
    --card-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.card-inner:hover {
    transform: rotateY(10deg) rotateX(10deg) translateZ(10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.card__liquid {
    position: absolute;
    top: -80px;
    left: 0;
    width: 300px;
    height: 200px;
    background: #4a90e2;
    border-radius: 50%;
    transform: translateZ(-80px);
    filter: blur(80px);
    transition:
        transform 0.7s cubic-bezier(0.36, 0, 0.66, -0.56),
        opacity 0.3s ease-in-out;
    opacity: 0;
}

.card-inner:hover .card__liquid {
    transform: translateZ(-50px) translateY(30px) translateX(-20px) rotate(-20deg)
        scale(1.2);
    opacity: 0.7;
}

.card__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.1) 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.card-inner:hover .card__shine {
    opacity: 1;
    animation: shine-effect 2s infinite linear;
}

.card__glow {
    position: absolute;
    inset: -15px;
    background: radial-gradient(
        circle at 50% 0%,
        rgba(255, 138, 101, 0.4) 0%,
        rgba(255, 138, 101, 0) 60%
    );
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.card-inner:hover .card__glow {
    opacity: 1;
}

.card__content {
    padding: 1.5em;
    padding-bottom: 0.25em;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1em;
    position: relative;
    z-index: 2;
    min-height: 0;
}

/* Badge always visible */
.card__badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 0.2em 0.45em;
    border-radius: 999px;
    font-size: 0.6em;
    font-weight: 600;
    transform: scale(1);
    opacity: 1;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    line-height: 1;
}

.card__badge-icon {
    display: inline-flex;
    align-items: center;
    font-size: 1em;
    line-height: 1;
}

.card__badge-icon svg {
    width: 0.9em;
    height: 0.9em;
    fill: currentColor;
}

.card__image {
    width: 100%;
    height: 120px;
    min-height: 120px;
    flex-shrink: 0;
    background: var(--bg-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 13px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-inner:hover .card__image {
    transform: translateY(-8px) scale(1.05);
}

.card__image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 20% 80%,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 40%
    ),
    repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.05) 0px,
        rgba(255, 255, 255, 0.05) 3px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.6;
}

/* Hide pattern overlay when image is present */
.card__image[style*="background-image"]::after {
    display: none;
}

.card__text {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.card__title {
    color: var(--card-text);
    font-size: 1em;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        color 0.4s ease-in-out,
        transform 0.4s ease-in-out;
}

.card-inner:hover .card__title {
    color: var(--card-accent);
    transform: translateX(3px);
}

.card__description {
    color: var(--card-text);
    font-size: 0.8em;
    margin: 0;
    opacity: 0.8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    transition:
        opacity 0.4s ease-in-out,
        transform 0.4s ease-in-out;
}

.card-inner:hover .card__description {
    opacity: 1;
    transform: translateX(3px);
}

/* Footer removed - no price and button */

/* Animations */
@keyframes shine-effect {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}


/* Responsive */
@media (max-width: 968px) {
    .games-container {
        padding: 1.5rem;
    }

    .games-header-title {
        font-size: 1.75rem;
    }

    .games-typewriter-text {
        font-size: 1.125rem;
    }

    .games-search-sort-bar {
        flex-direction: column;
        margin-bottom: 1.5rem;
    }

    .games-search-sort-bar .sort-select {
        width: 100%;
        min-width: 100%;
    }

    .games-filter-tabs {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .filter-tab {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        row-gap: 2rem;
    }
}

@media (max-width: 640px) {
    .games-container {
        padding: 1rem;
    }

    .games-header-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.25rem;
    }

    .games-header-icon svg {
        width: 28px;
        height: 28px;
    }

    .games-header-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .games-typewriter-text {
        font-size: 1rem;
        min-height: 1.5rem;
    }

    .games-filter-tabs {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        row-gap: 1.5rem;
    }

    .card__content {
        padding: 1.25em;
    }

    .card__image {
        height: 100px;
    }

    .card__title {
        font-size: 0.95em;
    }

    .card__description {
        font-size: 0.75em;
    }

    .games-cta-banner {
        padding: 1.75rem 1rem;
        margin: 0 auto -4rem;
        max-width: calc(100% - 2rem);
    }

    .games-cta-banner-title {
        font-size: 1.25rem;
    }

    .games-cta-banner-description {
        font-size: 0.8125rem;
    }

    .games-cta-banner-button {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Games and Library CTA Banner Section */
.games-cta-banner,
.library-cta-banner {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    padding: 3.5rem 2rem;
    margin: 0 auto -10rem;
    max-width: 1000px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
}

.games-cta-banner::before,
.library-cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>');
    opacity: 0.3;
}

.games-cta-banner-content,
.library-cta-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.games-cta-banner-text,
.library-cta-text {
    flex: 1;
    max-width: 600px;
}

.games-cta-banner-title,
.library-cta-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.games-cta-banner-description,
.library-cta-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.games-cta-banner-button,
.library-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: #2563eb;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.games-cta-banner-button:hover,
.library-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.games-cta-banner-icon,
.library-cta-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Games and Library CTA Banner Responsive */
@media (max-width: 968px) {
    .games-cta-banner,
    .library-cta-banner {
        padding: 3rem 1.5rem;
        margin: 0 auto -4rem;
        max-width: calc(100% - 3rem);
    }

    .games-cta-banner-content,
    .library-cta-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .games-cta-banner-text,
    .library-cta-text {
        max-width: 100%;
    }

    .games-cta-banner-title,
    .library-cta-title {
        font-size: 1.125rem;
    }

    .games-cta-banner-description,
    .library-cta-description {
        font-size: 0.8125rem;
    }

    .games-cta-banner-button,
    .library-cta-button {
        width: 100%;
        justify-content: center;
    }

    .welcome-footer {
        padding-top: 5.5rem;
    }
}

@media (max-width: 640px) {
    .games-cta-banner,
    .library-cta-banner {
        padding: 2.5rem 1rem;
        margin: 0 auto -3.5rem;
        max-width: calc(100% - 2rem);
        border-radius: 12px;
    }

    .welcome-footer {
        padding-top: 5.5rem;
    }

    .games-cta-banner-title,
    .library-cta-title {
        font-size: 1rem;
    }

    .games-cta-banner-description,
    .library-cta-description {
        font-size: 0.75rem;
    }

    .games-cta-banner-button,
    .library-cta-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
}

/* Library Card Button Styles (from tra.css) */
.game-card-item .card-inner {
    cursor: pointer;
}

.game-card-item .card__text {
    flex: 1 1 auto;
    flex-shrink: 1;
    min-height: 0;
    overflow: hidden;
}

.game-card-item .card__footer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5em;
    padding-bottom: 0.5rem;
    flex-shrink: 0;
    width: 100%;
}

/* Library and Games page card button - same style */
.game-card-item .card-library-btn,
.game-card-item .card-games-btn {
    padding: 0.375rem 0.625rem !important;
    font-size: 0.6875rem !important;
    width: 100%;
    justify-content: center;
    gap: 0.375rem !important;
    min-height: auto !important;
    line-height: 1.2 !important;
}

.game-card-item .card-library-btn .btn-icon,
.game-card-item .card-games-btn .btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.game-card-item .card-library-btn span,
.game-card-item .card-games-btn span {
    font-size: 0.6875rem !important;
    margin-left: 0 !important;
    line-height: 1.2;
}


/* Notifications Wrapper */
.notifications-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
}

.notifications-wrapper > * {
    pointer-events: auto;
}

/* Animations */
@keyframes pulse-button {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

