/* 搜索页特定样式 */

img{
    width: 100%;
}

/* 搜索区域 */
.search-section {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.search-section 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: searchTitleGlow 3s ease-in-out infinite;
}

@keyframes searchTitleGlow {
    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));
    }
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px;
    border: 2px solid rgba(155, 89, 182, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.search-box:focus-within {
    border-color: #F1C40F;
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.5);
    transform: scale(1.02);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1.1rem;
    padding: 15px 20px;
    border-radius: 50px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: linear-gradient(45deg, #9B59B6, #3498DB, #2ECC71);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.6);
}

/* 搜索建议 */
.search-suggestions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.suggestion-label {
    color: #cccccc;
    font-weight: 500;
    margin-right: 10px;
}

.suggestion-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.4);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.suggestion-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(241, 196, 15, 0.3), transparent);
    transition: left 0.5s;
}

.suggestion-tag:hover::before {
    left: 100%;
}

.suggestion-tag:hover {
    background: linear-gradient(45deg, #F1C40F, #FF6B6B);
    border-color: #F1C40F;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.5);
}

/* 搜索结果 */
.search-results {
    padding: 40px 0 80px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
    position: relative;
}

.results-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, #9B59B6, #3498DB, #2ECC71, #F1C40F);
    animation: headerLine 3s ease-in-out infinite;
}

@keyframes headerLine {
    0%, 100% {
        width: 100px;
        opacity: 1;
    }
    50% {
        width: 200px;
        opacity: 0.7;
    }
}

.results-header h2 {
    font-size: 2rem;
    background: linear-gradient(45deg, #9B59B6, #3498DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-count {
    color: #cccccc;
    font-size: 1.1rem;
}

/* 游戏网格增强 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.game-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 搜索高亮 */
.search-highlight {
    background: linear-gradient(45deg, #F1C40F, #FF6B6B, #3498DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
    animation: highlightGlow 2s ease-in-out infinite;
}

@keyframes highlightGlow {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #cccccc;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #E74C3C, #F1C40F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.no-results p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* 搜索动画 */
@keyframes searchPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.8);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(241, 196, 15, 0);
    }
}

.search-btn:active {
    animation: searchPulse 0.6s;
}

/* 结果淡入动画 */
@keyframes fadeInResult {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card.show {
    animation: fadeInResult 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-section {
        padding: 60px 0 40px;
    }

    .search-section h1 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }

    .search-box {
        max-width: 90%;
        margin: 0 auto 25px;
    }

    .search-input {
        font-size: 1rem;
        padding: 12px 15px;
    }

    .search-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .search-suggestions {
        gap: 10px;
    }

    .suggestion-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .results-header h2 {
        font-size: 1.8rem;
    }

    .search-results {
        padding: 30px 0 60px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .search-section h1 {
        font-size: 2rem;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .search-btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .suggestion-label {
        display: none;
    }

    .suggestion-tag {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .results-header h2 {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .no-results {
        padding: 60px 20px;
    }

    .no-results h3 {
        font-size: 1.5rem;
    }
}

/* 特殊视觉效果 */
.search-section::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: searchBgShift 10s ease-in-out infinite;
}

@keyframes searchBgShift {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.search-results::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.02) 50px,
            rgba(155, 89, 182, 0.02) 52px,
            transparent 54px,
            transparent 98px,
            rgba(52, 152, 219, 0.02) 100px
        );
    pointer-events: none;
    animation: searchResultsBgMove 20s linear infinite;
}

@keyframes searchResultsBgMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 150px 150px;
    }
}

/* 搜索框发光效果 */
.search-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #9B59B6, #3498DB, #2ECC71, #F1C40F, #FF6B6B);
    border-radius: 50px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: searchBoxGlow 3s linear infinite;
}

@keyframes searchBoxGlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.search-box:focus-within::before {
    opacity: 0.4;
}

/* 加载状态 */
.search-loading {
    display: none;
    text-align: center;
    padding: 40px;
    background: linear-gradient(45deg, #9B59B6, #3498DB);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.search-loading.active {
    display: block;
    animation: loadingFade 0.5s ease-out;
}

@keyframes loadingFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(155, 89, 182, 0.3);
    border-radius: 50%;
    border-top-color: #F1C40F;
    animation: spin 1s ease-in-out infinite;
    margin-right: 12px;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
