/* Tags Page Styles */

.tags-hero {
    background: var(--gradient-primary);
    padding: 4rem 0 3rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tags-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="p" patternUnits="userSpaceOnUse" width="20" height="20" patternTransform="rotate(45)"><rect width="10" height="20" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23p)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.tags-hero .container {
    position: relative;
    z-index: 1;
    padding-top: 31px;
}

.tags-hero h1 {
    font-size: var(--font-size-4xl);
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tags-hero p {
    font-size: var(--font-size-xl);
    margin: 0;
    opacity: 0.95;
    font-weight: 300;
}

.tag-games-section {
    background: var(--bg-primary);
    padding: var(--space-2xl) 0;
}

.tag-games-section .games-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: var(--space-2xl);
}

.tag-games-section .load-more-container {
     display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-2xl);
    padding-bottom: 10px;
}

.tag-games-section .load-more-btn {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    min-height: 44px;
    width: auto;
    min-width: 180px;
    display: inline-block;
    position: relative;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.tag-games-section .load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-2xl);
}

.pagination-container .pagination {
    display: flex;
    gap: var(--space-sm);
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-container .pagination li a {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 600;
}

.pagination-container .pagination li a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-container .pagination li.active a {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 1200px) {
    .tag-games-section .games-grid {
        grid-template-columns: repeat(4, minmax(180px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 1024px) {
    .tag-games-section .games-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .tags-hero {
        padding: 2.5rem 0 2rem;
    }

    .tags-hero h1 {
        font-size: var(--font-size-2xl);
    }

    .tags-hero p {
        font-size: var(--font-size-base);
    }

    .tag-games-section {
        padding: var(--space-xl) 0;
    }

    .tag-games-section .games-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .tag-games-section .game-card {
        width: 100%;
        max-width: none;
        margin: 0;
    }
    
    .pagination-container .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tag-games-section .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tag-games-section .game-card {
        width: 100%;
    }

    .tag-games-section .load-more-btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .tag-games-section .load-more-btn.loading::after {
        position: absolute;
        right: 16px;
        width: 16px;
        height: 16px;
        border: 2px solid transparent;
        border-top: 2px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }
    
    .pagination-container .pagination li a {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-sm);
    }
}

/* Category buttons styling */
.category-buttons {
    margin-bottom: 2rem;
    text-align: center;
}

.category-title h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.category-btn {
    padding: 0.5rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.category-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    position: relative;
}

.category-btn.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* Game Card Styles */
.game-card {
    background: linear-gradient(145deg, var(--bg-primary) 0%, rgba(249, 250, 251, 0.8) 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(229, 231, 235, 0.6);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06), 
                0 1px 2px rgba(0, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: inherit;
    position: relative;
    transform: translateY(0);
    will-change: transform, box-shadow, border-color;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15),
                0 8px 16px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(145deg, #ffffff 0%, rgba(249, 250, 251, 0.95) 100%);
}

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius-xl);
}

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

.game-card__image {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: linear-gradient(145deg, #f0f4f8, #e6ecf2);
    isolation: isolate;
}

.game-card__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    z-index: 1;
    pointer-events: none;
}

.game-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.5s ease;
    filter: brightness(0.98);
    z-index: 2;
    transform: scale(1);
}

.game-card:hover .game-card__image img {
    transform: scale(1.08);
    filter: brightness(1.05) contrast(1.05);
}

.game-featured {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4),
                0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: pulse-featured 2s infinite;
}

@keyframes pulse-featured {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4),
                    0 2px 4px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6),
                    0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: none;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
}

.placeholder-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-sm);
}

.placeholder-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.game-card__info {
    padding: 16px 16px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-top: 1px solid rgba(229, 231, 235, 0.5);
}

.game-card__title {
    font-size: var(--font-size-lg);
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: left;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    letter-spacing: -0.01em;
}

.game-card__description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.game-card__review {
    margin-top: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(251, 191, 36, 0.04) 100%);
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: #d97706;
    font-size: 0.8125rem;
    line-height: 1.5;
    font-weight: 500;
}

.line2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .button-group {
        gap: 0.5rem;
    }
    
    .category-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .game-card__info {
        padding: 12px;
        gap: 8px;
    }
    
    .game-card__title {
        font-size: var(--font-size-sm);
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .game-card__description {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .game-card:hover {
        transform: translateY(-8px) scale(1.01);
        box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12),
                    0 4px 8px rgba(0, 0, 0, 0.08);
    }
    
    .game-featured {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    .game-card__info {
        padding: 10px;
        gap: 6px;
    }
    
    .game-card__title {
        font-size: 0.8125rem;
        font-weight: 700;
    }
    
    .game-card__description {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .game-card__review {
        padding: 6px 10px;
        font-size: 0.75rem;
        margin-top: 2px;
    }
    
    .game-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 8px 16px rgba(59, 130, 246, 0.1),
                    0 2px 4px rgba(0, 0, 0, 0.06);
    }
}

