/* 分类页特定样式 */

/* 分类筛选器 */
.category-filter {
    padding: 80px 0 40px;
    text-align: center;
    position: relative;
}

.category-filter h1 {
    font-size: 3rem;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #9B59B6, #3498DB, #2ECC71, #F1C40F, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: categoryTitleGlow 3s ease-in-out infinite;
}

@keyframes categoryTitleGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 20px rgba(155, 89, 182, 0.5));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 30px rgba(241, 196, 15, 0.7));
    }
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(155, 89, 182, 0.4);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(241, 196, 15, 0.4), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(45deg, #9B59B6, #3498DB, #2ECC71);
    border-color: #F1C40F;
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
}

.filter-btn.active {
    animation: glow 2s infinite;
}

/* 游戏列表 */
.games-list {
    padding: 40px 0 80px;
}

/* 过滤动画 */
.game-card {
    transition: all 0.5s ease;
    opacity: 1;
    transform: scale(1);
}

.game-card.filtered {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.game-card.filtered-out {
    display: none;
}

/* 分类标签特效 */
.game-card[data-category="action"] {
    border-left: 4px solid #FF6B6B;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1), transparent);
}

.game-card[data-category="rpg"] {
    border-left: 4px solid #9B59B6;
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.1), transparent);
}

.game-card[data-category="shooter"] {
    border-left: 4px solid #E74C3C;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.1), transparent);
}

.game-card[data-category="strategy"] {
    border-left: 4px solid #3498DB;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.1), transparent);
}

.game-card[data-category="adventure"] {
    border-left: 4px solid #2ECC71;
    background: linear-gradient(90deg, rgba(46, 204, 113, 0.1), transparent);
}

.game-card[data-category="sports"] {
    border-left: 4px solid #F1C40F;
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.1), transparent);
}

.game-card[data-category="racing"] {
    border-left: 4px solid #FF8C00;
    background: linear-gradient(90deg, rgba(255, 140, 0, 0.1), transparent);
}

/* 悬停效果增强 */
.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(155, 89, 182, 0.4);
}

.game-card[data-category="action"]:hover {
    box-shadow: 0 25px 50px rgba(255, 107, 107, 0.5);
}

.game-card[data-category="rpg"]:hover {
    box-shadow: 0 25px 50px rgba(155, 89, 182, 0.5);
}

.game-card[data-category="shooter"]:hover {
    box-shadow: 0 25px 50px rgba(231, 76, 60, 0.5);
}

.game-card[data-category="strategy"]:hover {
    box-shadow: 0 25px 50px rgba(52, 152, 219, 0.5);
}

.game-card[data-category="adventure"]:hover {
    box-shadow: 0 25px 50px rgba(46, 204, 113, 0.5);
}

.game-card[data-category="sports"]:hover {
    box-shadow: 0 25px 50px rgba(241, 196, 15, 0.5);
}

.game-card[data-category="racing"]:hover {
    box-shadow: 0 25px 50px rgba(255, 140, 0, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-filter {
        padding: 60px 0 30px;
    }

    .category-filter h1 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .games-list {
        padding: 30px 0 60px;
    }
}

@media (max-width: 480px) {
    .category-filter h1 {
        font-size: 2rem;
    }

    .filter-buttons {
        justify-content: center;
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .games-list {
        padding: 20px 0 40px;
    }
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.6s ease-out;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }
.game-card:nth-child(7) { animation-delay: 0.7s; }
.game-card:nth-child(8) { animation-delay: 0.8s; }
.game-card:nth-child(9) { animation-delay: 0.9s; }
.game-card:nth-child(10) { animation-delay: 1.0s; }
.game-card:nth-child(11) { animation-delay: 1.1s; }
.game-card:nth-child(12) { animation-delay: 1.2s; }

/* 特殊视觉效果 */
.category-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(52, 152, 219, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(241, 196, 15, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: categoryBgShift 8s ease-in-out infinite;
}

@keyframes categoryBgShift {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.games-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 48px,
            rgba(155, 89, 182, 0.03) 50px,
            rgba(155, 89, 182, 0.03) 52px,
            transparent 54px,
            transparent 98px,
            rgba(52, 152, 219, 0.03) 100px
        );
    pointer-events: none;
    animation: gamesListBgMove 15s linear infinite;
}

@keyframes gamesListBgMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100px 100px;
    }
}

/* 计数动画 */
.filter-btn::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(45deg, #F1C40F, #FF6B6B);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.filter-btn.active::after {
    opacity: 1;
    transform: scale(1);
    animation: countBounce 0.5s ease-out;
}

@keyframes countBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
