/**
 * game-search.css
 * 游戏搜索功能样式 - 搜索结果展示和交互效果
 */

/* 移动端搜索容器相对定位 */
.mobile-sidebar-search-container {
    position: relative;
}

/* 搜索结果容器 - 主要样式和定位 */
.search-results-container {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 180px;
    background: rgba(45, 45, 45, 0.9); /* 0.9透明度背景 */
    border: none; /* 去掉边框线条 */
    border-radius: 1rem; /* 更圆润的圆角 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0;
    box-sizing: border-box;
    backdrop-filter: blur(8px); /* 背景模糊效果 */
}

/* 搜索结果列表容器 */
.search-results-list {
    padding: 0.5rem 0;
}

/* 搜索结果项 - 单个游戏项样式 */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    /* 去掉横线分割 */
}

/* 搜索结果项悬停效果 */
.search-result-item:hover {
    background-color: rgba(55, 65, 81, 0.6);
}

/* 悬停时游戏名称变绿色 */
.search-result-item:hover .search-result-name {
    color: #d6fe51;
}

/* 搜索结果项激活效果 */
.search-result-item:active {
    background-color: rgba(75, 85, 99, 0.6);
}

/* 游戏图标样式（预留，当前不使用） */
.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    margin-right: 0.75rem;
    object-fit: cover;
    flex-shrink: 0;
}

/* 游戏信息容器 */
.search-result-info {
    flex: 1;
    min-width: 0;
}

/* 游戏名称样式 */
.search-result-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: #f5f5f7;
    font-size: 1rem;
    line-height: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 游戏分类样式（预留） */
.search-result-category {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: capitalize;
    line-height: 1rem;
}

/* 无搜索结果提示样式 */
.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.875rem;
    font-family: 'Nunito', sans-serif;
}

/* 加载状态样式（预留） */
.search-loading {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 移动端响应式适配 */
@media (max-width: 768px) {
    .search-results-container {
        max-height: 250px;
        border-radius: 0.875rem; /* 移动端稍小的圆角 */
    }
    
    .search-result-item {
        padding: 0.625rem 0.875rem;
    }
    
    .search-result-icon {
        width: 36px;
        height: 36px;
        margin-right: 0.625rem;
    }
    
    .search-result-name {
        font-size: 0.8125rem;
    }
    
    .search-result-category {
        font-size: 0.6875rem;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .search-results-container {
        background: rgba(31, 41, 55, 0.7); /* 暗色主题透明背景 */
        border: none; /* 暗色主题也去掉边框 */
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    }
    
    .search-result-item:hover {
        background-color: rgba(55, 65, 81, 0.6);
    }
    
    /* 暗色主题悬停时游戏名称也变绿色 */
    .search-result-item:hover .search-result-name {
        color: #d6fe51;
    }
    
    .search-result-item:active {
        background-color: rgba(75, 85, 99, 0.6);
    }
    
    .search-result-name {
        color: #f9fafb;
    }
    
    .search-result-category {
        color: #9ca3af;
    }
    
    .search-no-results,
    .search-loading {
        color: #9ca3af;
    }
}

/* 自定义滚动条样式 */
.search-results-container::-webkit-scrollbar {
    width: 6px;
}

.search-results-container::-webkit-scrollbar-track {
    background: rgba(55, 65, 81, 0.3);
    border-radius: 3px;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.6);
    border-radius: 3px;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.8);
}

/* 暗色主题滚动条 */
@media (prefers-color-scheme: dark) {
    .search-results-container::-webkit-scrollbar-track {
        background: rgba(55, 65, 81, 0.3);
    }
    
    .search-results-container::-webkit-scrollbar-thumb {
        background: rgba(107, 114, 128, 0.6);
    }
    
    .search-results-container::-webkit-scrollbar-thumb:hover {
        background: rgba(156, 163, 175, 0.8);
    }
} 