/**
 * Gallery Art Management - 搜索功能样式
 */

/* ===== 搜索表单 ===== */
.gam-search-form {
    margin: 20px 0;
}

.gam-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 600px;
    margin-bottom: 15px;
}

.gam-search-field {
    flex: 1;
    padding: 12px 50px 12px 20px;
    border: 2px solid #e5e5e5;
    border-radius: 25px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.gam-search-field:focus {
    outline: none;
    border-color: #0073aa;
}

.gam-search-submit {
    position: absolute;
    right: 5px;
    width: 40px;
    height: 40px;
    border: none;
    background: #0073aa;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.gam-search-submit:hover {
    background: #005177;
}

.gam-search-submit .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.gam-search-submit .screen-reader-text {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0;
    border: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ===== 高级筛选器 ===== */
.gam-advanced-filters {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.gam-filter-row {
    margin-bottom: 15px;
}

.gam-filter-row:last-child {
    margin-bottom: 0;
}

.gam-filter-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.gam-filter-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.gam-toggle-filters {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.gam-toggle-filters:hover {
    border-color: #0073aa;
    color: #0073aa;
}

/* ===== 实时搜索结果 ===== */
.gam-live-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
}

.gam-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.gam-loading .dashicons {
    animation: gam-spin 1s linear infinite;
}

@keyframes gam-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gam-no-results,
.gam-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.gam-error {
    color: #d63638;
}

/* 搜索结果列表 */
.gam-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.gam-result-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.gam-result-item:last-child {
    border-bottom: none;
}

.gam-result-item.active,
.gam-result-item:hover {
    background: #f9f9f9;
}

.gam-result-item a {
    display: flex;
    padding: 12px;
    text-decoration: none;
    color: inherit;
}

.gam-result-thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-right: 12px;
}

.gam-result-content {
    flex: 1;
}

.gam-result-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.gam-result-artist {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #0073aa;
}

.gam-result-excerpt {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.gam-result-content mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* 查看全部链接 */
.gam-view-all {
    padding: 12px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background: #f9f9f9;
    border-radius: 0 0 8px 8px;
}

.gam-view-all a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.gam-view-all a:hover {
    text-decoration: underline;
}

/* ===== 搜索结果页面 ===== */
.search-results .search-highlight,
.gam-collection-archive mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
}

.search-no-results h2 {
    margin-bottom: 20px;
    color: #666;
}

/* 搜索统计 */
.search-stats {
    margin: 20px 0;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #0073aa;
    border-radius: 0 4px 4px 0;
}

.search-stats p {
    margin: 0;
    color: #555;
}

/* ===== 搜索小工具 ===== */
.widget_gam_search {
    margin-bottom: 30px;
}

.widget_gam_search .widget-title {
    margin-bottom: 15px;
}

.widget_gam_search .gam-search-wrapper {
    max-width: 100%;
}

/* ===== 响应式设计 ===== */
@media screen and (max-width: 768px) {
    .gam-search-wrapper {
        max-width: 100%;
    }
    
    .gam-search-field {
        font-size: 14px;
        padding: 10px 45px 10px 15px;
    }
    
    .gam-search-submit {
        width: 35px;
        height: 35px;
    }
    
    .gam-advanced-filters {
        padding: 15px;
    }
    
    .gam-result-thumb {
        width: 50px;
        height: 50px;
        min-width: 50px;
    }
    
    .gam-result-content h4 {
        font-size: 14px;
    }
    
    .gam-result-artist,
    .gam-result-excerpt {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    .gam-filter-row {
        margin-bottom: 12px;
    }
    
    .gam-result-item a {
        padding: 10px;
    }
    
    .gam-result-thumb {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin-right: 10px;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .gam-search-form,
    .gam-live-results {
        display: none !important;
    }
}

