/* 图片搜索功能样式 */

.image-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 200ms ease;
}

.image-search-icon:hover {
    opacity: 0.7;
}

.image-search-icon svg {
    width: 100%;
    height: 100%;
}

/* 搜索输入框带相机图标时的内边距调整 */
.search-input-field.has-camera,
.search-box__input.has-camera {
    padding-left: 48px;
}

/* 下拉面板方向 - 确保面板在有相机图标时也正确显示 */
.search-input-container .search-dropdown-panel,
.search-dropdown-panel.down {
    top: calc(100% + 12px);
    bottom: auto;
}

.search-box .search-dropdown-panel,
.search-dropdown-panel.up {
    bottom: calc(100% + 12px);
    top: auto;
}

/* 图片上传区域样式 */
.image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    padding: 40px 20px;
    text-align: center;
    transition: all 200ms ease;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.image-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #e0f2fe;
    border-style: solid;
}

.upload-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all .2s ease;
    margin-bottom: 16px;
}

.upload-button:hover {
    background: var(--primary-color-hover);
}

.upload-button:active {
    background-color: var(--primary-color-active);
    transform: scale(0.95);
}

.upload-hint {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #6b7280;
    margin: 8px 0 0 0;
}

.upload-formats {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: #9ca3af;
    margin: 4px 0 0 0;
}

/* 隐藏的文件输入 */
.image-upload-input {
    display: none;
}

/* 图片预览 */
.image-preview {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 8px;
}

.image-preview.show {
    display: block;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}

.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 200ms ease;
}

.image-preview-remove:hover {
    background: #dc2626;
}

.image-search-button {
    margin-top: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 24px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 200ms ease;
}

.image-search-button:hover {
    background: var(--primary-color-hover);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .image-upload-area {
        padding: 32px 16px;
    }

    .upload-button {
        padding: 10px 24px;
        font-size: 14px;
    }

    .upload-hint {
        font-size: 13px;
    }

    .image-preview img {
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .image-upload-area {
        padding: 24px 12px;
    }

    .upload-button {
        padding: 8px 20px;
        font-size: 13px;
    }

    .upload-hint {
        font-size: 12px;
    }

    .upload-formats {
        font-size: 11px;
    }

    .image-preview img {
        max-width: 120px;
        max-height: 120px;
    }

    .image-search-icon {
        left: 12px;
        width: 20px;
        height: 20px;
    }

    .search-input-field.has-camera,
    .search-box__input.has-camera {
        padding-left: 40px;
    }
}
